From 16434bb3a176f4d099a7311b60a57953d74e31da Mon Sep 17 00:00:00 2001 From: Marco Lombardo Date: Mon, 4 Mar 2024 12:38:15 +0000 Subject: [PATCH 1/3] LB-132: Avoid unnecessary escaping for non HTML email body --- application/controllers/admin/DataEntry.php | 5 +++-- application/libraries/Save.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/application/controllers/admin/DataEntry.php b/application/controllers/admin/DataEntry.php index 118de9277c8..10e0c21bf27 100644 --- a/application/controllers/admin/DataEntry.php +++ b/application/controllers/admin/DataEntry.php @@ -1922,11 +1922,12 @@ public function insert() $mailer->addAddress($saver['email']); $mailer->setSurvey($surveyid); $mailer->emailType = 'savesurveydetails'; + $mailer->isHTML(false); $mailer->Subject = gT("Saved Survey Details"); - $message = gT("Thank you for saving your survey in progress. The following details can be used to return to this survey and continue where you left off."); + $message = gT("Thank you for saving your survey in progress. The following details can be used to return to this survey and continue where you left off.", "unescaped"); $message .= "\n\n" . $thissurvey['name'] . "\n\n"; $message .= gT("Name") . ": " . $saver['identifier'] . "\n"; - $message .= gT("Reload your survey by clicking on the following link (or pasting it into your browser):") . "\n"; + $message .= gT("Reload your survey by clicking on the following link (or pasting it into your browser):", "unescaped") . "\n"; $aParams = array('lang' => $saver['language'], 'loadname' => $saver['identifier']); $message .= Yii::app()->getController()->createAbsoluteUrl("/survey/index/sid/{$surveyid}/loadall/reload/scid/{$arSaveControl->scid}/", $aParams); $mailer->Body = $message; diff --git a/application/libraries/Save.php b/application/libraries/Save.php index 9c9cf083c4a..f0cc1f4c3be 100644 --- a/application/libraries/Save.php +++ b/application/libraries/Save.php @@ -211,11 +211,11 @@ function saveSurvey() $mailer->emailType = 'savesurveydetails'; $mailer->isHTML(false); $mailer->Subject = gT("Saved Survey Details") . " - " . $thissurvey['name']; - $message = gT("Thank you for saving your survey in progress. The following details can be used to return to this survey and continue where you left off. Please make sure to remember your password - we cannot retrieve it for you."); + $message = gT("Thank you for saving your survey in progress. The following details can be used to return to this survey and continue where you left off. Please make sure to remember your password - we cannot retrieve it for you.", "unescaped"); $message .= "\n\n" . $thissurvey['name'] . "\n\n"; $message .= gT("Name") . ": " . Yii::app()->getRequest()->getPost('savename') . "\n"; $message .= gT("Password") . ": ***************\n\n"; - $message .= gT("Reload your survey by clicking on the following link (or pasting it into your browser):") . "\n"; + $message .= gT("Reload your survey by clicking on the following link (or pasting it into your browser):", "unescaped") . "\n"; $aParams = array('scid' => $scid, 'lang' => App()->language); if (!empty($clienttoken)) { $aParams['token'] = $clienttoken; From 930bef7c1bfb88d471cb3a0d384768423b30af1c Mon Sep 17 00:00:00 2001 From: Marco Lombardo Date: Mon, 4 Mar 2024 17:22:42 +0000 Subject: [PATCH 2/3] LB-132: Revert changes to DataEntry --- application/controllers/admin/DataEntry.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/controllers/admin/DataEntry.php b/application/controllers/admin/DataEntry.php index 10e0c21bf27..118de9277c8 100644 --- a/application/controllers/admin/DataEntry.php +++ b/application/controllers/admin/DataEntry.php @@ -1922,12 +1922,11 @@ public function insert() $mailer->addAddress($saver['email']); $mailer->setSurvey($surveyid); $mailer->emailType = 'savesurveydetails'; - $mailer->isHTML(false); $mailer->Subject = gT("Saved Survey Details"); - $message = gT("Thank you for saving your survey in progress. The following details can be used to return to this survey and continue where you left off.", "unescaped"); + $message = gT("Thank you for saving your survey in progress. The following details can be used to return to this survey and continue where you left off."); $message .= "\n\n" . $thissurvey['name'] . "\n\n"; $message .= gT("Name") . ": " . $saver['identifier'] . "\n"; - $message .= gT("Reload your survey by clicking on the following link (or pasting it into your browser):", "unescaped") . "\n"; + $message .= gT("Reload your survey by clicking on the following link (or pasting it into your browser):") . "\n"; $aParams = array('lang' => $saver['language'], 'loadname' => $saver['identifier']); $message .= Yii::app()->getController()->createAbsoluteUrl("/survey/index/sid/{$surveyid}/loadall/reload/scid/{$arSaveControl->scid}/", $aParams); $mailer->Body = $message; From 1c6f4206eda08c4892b0ca152fe34b66e51f5e02 Mon Sep 17 00:00:00 2001 From: Marco Lombardo Date: Tue, 5 Mar 2024 10:53:32 +0000 Subject: [PATCH 3/3] LB-132: Remove escaping from other pieces of the message --- application/libraries/Save.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/libraries/Save.php b/application/libraries/Save.php index f0cc1f4c3be..3691a827cac 100644 --- a/application/libraries/Save.php +++ b/application/libraries/Save.php @@ -210,11 +210,11 @@ function saveSurvey() $mailer->setSurvey($thissurvey['sid']); $mailer->emailType = 'savesurveydetails'; $mailer->isHTML(false); - $mailer->Subject = gT("Saved Survey Details") . " - " . $thissurvey['name']; + $mailer->Subject = gT("Saved Survey Details", "unescaped") . " - " . $thissurvey['name']; $message = gT("Thank you for saving your survey in progress. The following details can be used to return to this survey and continue where you left off. Please make sure to remember your password - we cannot retrieve it for you.", "unescaped"); $message .= "\n\n" . $thissurvey['name'] . "\n\n"; - $message .= gT("Name") . ": " . Yii::app()->getRequest()->getPost('savename') . "\n"; - $message .= gT("Password") . ": ***************\n\n"; + $message .= gT("Name", "unescaped") . ": " . Yii::app()->getRequest()->getPost('savename') . "\n"; + $message .= gT("Password", "unescaped") . ": ***************\n\n"; $message .= gT("Reload your survey by clicking on the following link (or pasting it into your browser):", "unescaped") . "\n"; $aParams = array('scid' => $scid, 'lang' => App()->language); if (!empty($clienttoken)) {