From f773f69bd5de9d14cafe243dbad9a4adc99f3019 Mon Sep 17 00:00:00 2001 From: Naomi Carrigan Date: Sat, 23 Sep 2023 02:08:06 -0700 Subject: [PATCH] fix: uri encode forum title (#51625) --- .../templates/Challenges/redux/create-question-epic.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/templates/Challenges/redux/create-question-epic.js b/client/src/templates/Challenges/redux/create-question-epic.js index 6f84266f10d..d2933b51ba3 100644 --- a/client/src/templates/Challenges/redux/create-question-epic.js +++ b/client/src/templates/Challenges/redux/create-question-epic.js @@ -119,9 +119,11 @@ function createQuestionEpic(action$, state$, { window }) { const addCodeThree = i18next.t('forum-help.add-code-three'); const altTextMessage = `${whatsHappeningHeading}\n\n${camperCodeHeading}\n\n${warning}\n\n${tooLongOne}\n\n${tooLongTwo}\n\n${tooLongThree}\n\n\`\`\`text\n${addCodeOne}\n${addCodeTwo}\n${addCodeThree}\n\`\`\`\n\n${endingText}`; - const titleText = `${i18next.t( - `intro:${superBlock}.blocks.${block}.title` - )} - ${challengeTitle}`; + const titleText = window.encodeURIComponent( + `${i18next.t( + `intro:${superBlock}.blocks.${block}.title` + )} - ${challengeTitle}` + ); const category = window.encodeURIComponent( i18next.t('links:help.' + helpCategory || 'Help')