Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue: HTML tags are not allowed for admins in participant attributes #2627

Merged
merged 2 commits into from Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions application/controllers/RegisterController.php
Expand Up @@ -337,12 +337,12 @@ public function getTokenId($iSurveyId)
} else {
// TODO : move xss filtering in model
$oToken = Token::create($iSurveyId);
$oToken->firstname = sanitize_xss_string($aFieldValue['sFirstName']);
$oToken->lastname = sanitize_xss_string($aFieldValue['sLastName']);
$oToken->firstname = $aFieldValue['sFirstName'];
$oToken->lastname = $aFieldValue['sLastName'];
$oToken->email = $aFieldValue['sEmail'];
$oToken->emailstatus = 'OK';
$oToken->language = $sLanguage;
$aFieldValue['aAttribute'] = array_map('sanitize_xss_string', $aFieldValue['aAttribute']);
$aFieldValue['aAttribute'] = $aFieldValue['aAttribute'];
$oToken->setAttributes($aFieldValue['aAttribute']);
if ($aSurveyInfo['startdate']) {
$oToken->validfrom = $aSurveyInfo['startdate'];
Expand All @@ -351,6 +351,7 @@ public function getTokenId($iSurveyId)
$oToken->validuntil = $aSurveyInfo['expires'];
}
$oToken->generateToken();
$oToken->setScenario('register');
$oToken->encryptSave(true);
$this->sMailMessage = gT("An email has been sent to the address you provided with access details for this survey. Please follow the link in that email to proceed.");
return $oToken->tid;
Expand Down
7 changes: 6 additions & 1 deletion application/models/Token.php
Expand Up @@ -438,7 +438,12 @@ public function rules()
$aRules[] = array(
$key, 'filter',
'filter' => array(self::class, 'sanitizeAttribute'),
'except' => 'FinalSubmit'
'on' => 'register'
);
$aRules[] = array(
$key,
'LSYii_Validators',
'except' => 'finalSubmit,register'
c-schmitz marked this conversation as resolved.
Show resolved Hide resolved
);
}
return $aRules;
Expand Down