Skip to content

Commit

Permalink
Fixed issue #14288: TOKEN:ATTRIBUTE_INT not replaced in expression fo…
Browse files Browse the repository at this point in the history
…r email and reminder

Dev: Use of LimeExpressionManager::singleton()->loadTokenInformation
  • Loading branch information
Shnoulle committed Nov 27, 2018
1 parent 008711d commit 2cc399d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/controllers/admin/tokens.php
Expand Up @@ -1337,9 +1337,8 @@ public function email($iSurveyId)
$emcount = count($emresult);

foreach ($aSurveyLangs as $language) {
// See #08683 : this allow use of {TOKEN:ANYTHING}, directly replaced by {ANYTHING}
$sSubject[$language] = preg_replace("/{TOKEN:([A-Z0-9_]+)}/", "{"."$1"."}", Yii::app()->request->getPost('subject_'.$language, ''));
$sMessage[$language] = preg_replace("/{TOKEN:([A-Z0-9_]+)}/", "{"."$1"."}", Yii::app()->request->getPost('message_'.$language, ''));
$sSubject[$language] = Yii::app()->request->getPost('subject_'.$language, '');
$sMessage[$language] = Yii::app()->request->getPost('message_'.$language, '');
if ($bHtml) {
$sMessage[$language] = html_entity_decode($sMessage[$language], ENT_QUOTES, Yii::app()->getConfig("emailcharset"));
}
Expand All @@ -1350,7 +1349,6 @@ public function email($iSurveyId)
$bSendError = false;
if ($emcount > 0) {
foreach ($emresult as $emrow) {

if ($this->tokenIsSetInEmailCache($iSurveyId, $emrow['tid'])) {
// The email has already been send this session, skip.
// Happens if user reloads page or double clicks on "Send".
Expand All @@ -1369,6 +1367,8 @@ public function email($iSurveyId)
}

$fieldsarray["{SID}"] = $iSurveyId;
/* mantis #14288 */
LimeExpressionManager::singleton()->loadTokenInformation($iSurveyId, $emrow['token']);
foreach ($emrow as $attribute => $value) {
$fieldsarray['{'.strtoupper($attribute).'}'] = $value;
}
Expand Down

0 comments on commit 2cc399d

Please sign in to comment.