Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed issue #08887: Question text and help : unable to use html entit…
…ies of < and > for admin Dev: did we need to move fixCKeditor to model, think yes but unsure
- Loading branch information
Showing
2 changed files
with
53 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,10 @@ function index($sa = null) | |
$iQuestionID=returnGlobal('qid'); | ||
$sDBOutput = ''; | ||
|
||
$oFixCKeditor= new LSYii_Validators; | ||
$oFixCKeditor->fixCKeditor=true; | ||
$oFixCKeditor->xssfilter=false; | ||
|
||
if ($sAction == "updatedefaultvalues" && Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent','update')) | ||
{ | ||
|
||
|
@@ -144,7 +148,7 @@ function index($sa = null) | |
$sAnswerText=Yii::app()->request->getPost('answer_'.$sLanguage.'_'.$iSortOrderID.'_'.$iScaleID); | ||
|
||
// Fix bug with FCKEditor saving strange BR types | ||
$sAnswerText=fixCKeditorText($sAnswerText); | ||
$sAnswerText=$oFixCKeditor->fixCKeditor($sAnswerText); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Shnoulle
Author
Collaborator
|
||
// Now we insert the answers | ||
$iInsertCount=Answer::model()->insertRecords(array('code'=>$sCode, | ||
'answer'=>$sAnswerText, | ||
|
@@ -357,12 +361,11 @@ function index($sa = null) | |
$iQuestionOrder=(getMaxQuestionOrder($iQuestionGroupID,$iSurveyID)); | ||
$iQuestionOrder++; | ||
} | ||
// é to é and & to & : really needed ? Why not for answers ? (140307) | ||
$sQuestionText=html_entity_decode(Yii::app()->request->getPost('question_'.$sBaseLanguage), ENT_QUOTES, "UTF-8"); | ||
$sQuestionHelp=html_entity_decode(Yii::app()->request->getPost('help_'.$sBaseLanguage), ENT_QUOTES, "UTF-8"); | ||
$sQuestionText=Yii::app()->request->getPost('question_'.$sBaseLanguage,''); | ||
$sQuestionHelp=Yii::app()->request->getPost('help_'.$sBaseLanguage,''); | ||
// Fix bug with FCKEditor saving strange BR types : in rules ? | ||
$sQuestionText=fixCKeditorText($sQuestionText); | ||
$sQuestionHelp=fixCKeditorText($sQuestionHelp); | ||
$sQuestionText=$oFixCKeditor->fixCKeditor($sQuestionText); | ||
$sQuestionHelp=$oFixCKeditor->fixCKeditor($sQuestionHelp); | ||
|
||
$iQuestionID=0; | ||
$oQuestion= new Question; | ||
|
@@ -734,11 +737,11 @@ function index($sa = null) | |
if (isset($qlang) && $qlang != "") | ||
{ | ||
// é to é and & to & : really needed ? Why not for answers ? (130307) | ||
$sQuestionText=html_entity_decode(Yii::app()->request->getPost('question_'.$qlang), ENT_QUOTES, "UTF-8"); | ||
$sQuestionHelp=html_entity_decode(Yii::app()->request->getPost('help_'.$qlang), ENT_QUOTES, "UTF-8"); | ||
$sQuestionText=Yii::app()->request->getPost('question_'.$qlang,''); | ||
$sQuestionHelp=Yii::app()->request->getPost('help_'.$qlang,''); | ||
// Fix bug with FCKEditor saving strange BR types : in rules ? | ||
$sQuestionText=fixCKeditorText($sQuestionText); | ||
$sQuestionHelp=fixCKeditorText($sQuestionHelp); | ||
$sQuestionText=$oFixCKeditor->fixCKeditor($sQuestionText); | ||
$sQuestionHelp=$oFixCKeditor->fixCKeditor($sQuestionHelp); | ||
$udata = array( | ||
'type' => Yii::app()->request->getPost('type'), | ||
'title' => Yii::app()->request->getPost('title'), | ||
|
@@ -904,10 +907,10 @@ function index($sa = null) | |
$welcome = Yii::app()->request->getPost('welcome_'.$langname); | ||
$endtext = Yii::app()->request->getPost('endtext_'.$langname); | ||
|
||
$short_title=fixCKeditorText($short_title); | ||
$description=fixCKeditorText($description); | ||
$welcome=fixCKeditorText($welcome); | ||
$endtext=fixCKeditorText($endtext); | ||
$short_title=$oFixCKeditor->fixCKeditor($short_title); | ||
$description=$oFixCKeditor->fixCKeditor($description); | ||
$welcome=$oFixCKeditor->fixCKeditor($welcome); | ||
$endtext=$oFixCKeditor->fixCKeditor($endtext); | ||
|
||
$data = array( | ||
'surveyls_title' => $short_title, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I think we can move it to model and remove the fixCkEditorText used in common_helper. But : not used when importing or when use remote_control.
With RC : you can add a question texte with only a [space], not with admin edition.
If OK: do it monday (questiongroup and surveyadmin controllers use fixCkEditorText