From e1dae7f2f6a8d822b5c49363178c520114a7cc8b Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 21 Mar 2020 19:02:54 +0100 Subject: [PATCH] Fix questions encoding issue --- src/controllers/SettingsController.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/SettingsController.ts b/src/controllers/SettingsController.ts index fac1919..70f39f5 100644 --- a/src/controllers/SettingsController.ts +++ b/src/controllers/SettingsController.ts @@ -7,7 +7,7 @@ import { RequestHandler } from "../entities/RequestHandler"; import { UserHelper } from "../helpers/UserHelper"; import { GeneralSettings, UserPageStatus, SupportedLanguages, LangSettings } from "../entities/User"; -import { removeHTMLNodes, checkURL } from "../utils/StringUtils"; +import { removeHTMLNodes, checkURL, fixEncoding } from "../utils/StringUtils"; import { checkVirtualDirectoryAvailability, VirtualDirType } from "../utils/VirtualDirsUtils"; import { AccountHelper } from "../helpers/AccountHelper"; @@ -148,10 +148,10 @@ export class SettingsController { h.send({ id: userInfo.id, - security_question_1: userInfo.hasSecurityQuestion1 ? userInfo.security_question_1 : "", - security_answer_1: userInfo.hasSecurityAnswer1 ? userInfo.security_answer_1 : "", - security_question_2: userInfo.hasSecurityQuestion2 ? userInfo.security_question_2 : "", - security_answer_2: userInfo.hasSecurityAnswer2 ? userInfo.security_answer_2 : "", + security_question_1: userInfo.hasSecurityQuestion1 ? fixEncoding(userInfo.security_question_1) : "", + security_answer_1: userInfo.hasSecurityAnswer1 ? fixEncoding(userInfo.security_answer_1) : "", + security_question_2: userInfo.hasSecurityQuestion2 ? fixEncoding(userInfo.security_question_2) : "", + security_answer_2: userInfo.hasSecurityAnswer2 ? fixEncoding(userInfo.security_answer_2) : "", }); } } \ No newline at end of file