View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
08592Bug reportsSurvey editingpublic2014-01-31 17:32
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary08592: Bad HTML in question break layout
Description

If user put bad HTML in question text, it can break completely the layout.
A good exemple is open table and don't close it.

Steps To Reproduce

Deactivate HTML editor
Create a survey/add a group/add a question and put:
Bad HTML<br />
<table>
<tbody>

Additional Information

If user put <span style="font-size:50px">Great title</span> the great title are show wit 50px .
It's due to the way of EM manage the HTML, we remove tag expcet span/table/td/tr ...

TagsNo tags attached.
Attached Files
Bug heat4
Complete LimeSurvey version number (& build)140124
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Versionnot relevant

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2014-01-24 19:16

developer   ~28126

Last edited: 2014-01-24 19:35

A way to corect this:
In questionbar_view:
line 166 (and other for help)
templatereplace(FlattenText($qrrow['question']),array(),$aReplacementData,'Unspecified', false ,$qid);
echo LimeExpressionManager::GetLastPrettyPrintExpression();

We flatten the text before templatereplace: there are no way to see some error. But not sure actually there are a way to see some error.

For survey logic file : adding </td> (closing cell) break layout.
But here : we don't do anyting (except for script). Maybe it's better like this.


This was silly .... some user want to use script
An alternative is to use CHTMLpurifier in question::models. The we are 'sure' to have a clean HTML.

But i think it can break some using.
<h1 class="{QCODE}">Title</h1>
Or maybe
{if(QCODE=="A","<strong class='error'>Error</strong>","<span class='success'>OK</span>")}

DenisChenu

DenisChenu

2014-01-26 17:05

developer   ~28214

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=13776

DenisChenu

DenisChenu

2014-01-26 17:07

developer   ~28215

Only fix "Question view" actually.
Then user can see if there are a problem survey logic HTML like before
Don't found a way when : before it's show error and not now.

c_schmitz

c_schmitz

2014-01-31 17:32

administrator   ~28350

LimeSurvey 2-05+ Build 140131 released

Related Changesets

LimeSurvey: master 2de5433e

2014-01-26 16:05:31

DenisChenu

Details Diff
Fixed issue 08592: Bad HTML in question break layout
Dev: FlattenText before LEM, but don't change really error viewing
Dev: FlattenText can be replaced with : strip_tags or CHtml::pirifier if needed
Affected Issues
08592
mod - application/views/admin/survey/Question/questionbar_view.php Diff File

Issue History

Date Modified Username Field Change
2014-01-24 18:37 DenisChenu New Issue
2014-01-24 18:37 DenisChenu File Added: Capture du 2014-01-24 18:35:10.png
2014-01-24 18:37 DenisChenu File Added: Capture du 2014-01-24 18:36:16.png
2014-01-24 18:37 DenisChenu File Added: Capture du 2014-01-24 18:36:48.png
2014-01-24 18:40 DenisChenu File Added: Capture du 2014-01-24 18:39:57.resized.png
2014-01-24 19:16 DenisChenu Note Added: 28126
2014-01-24 19:17 DenisChenu Note Edited: 28126
2014-01-24 19:35 DenisChenu Note Edited: 28126
2014-01-26 16:58 DenisChenu File Added: limesurvey_survey_BrokenLayout.lss
2014-01-26 16:58 DenisChenu Assigned To => DenisChenu
2014-01-26 16:58 DenisChenu Status new => assigned
2014-01-26 17:05 DenisChenu Changeset attached => LimeSurvey master 2de5433e
2014-01-26 17:05 DenisChenu Note Added: 28214
2014-01-26 17:05 DenisChenu Resolution open => fixed
2014-01-26 17:07 DenisChenu Note Added: 28215
2014-01-26 17:07 DenisChenu Status assigned => resolved
2014-01-26 17:07 DenisChenu Fixed in Version => 2.05+
2014-01-31 17:32 c_schmitz Note Added: 28350
2014-01-31 17:32 c_schmitz Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing