Anonymous Login
2016-10-23 08:05 CEST

View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
06946Bug reports[All Projects] Survey designpublic2013-02-26 20:03
Assigned Todamien 
Product Version2.00+ 
Target VersionFixed in Version2.00+ 
Summary06946: "Quick-add" fail to parse expressions with ' " '
DescriptionThe "Quick-add" feature in the label set / subquestions editor fail to parse expressions with ' " ' (a quotation mark).
Steps To Reproduce1. Go to "Edit subquestions" of a question
2. Click on "Quick add..."
3. Enter : a"a
4. Click "Add"

What should happens:
A new subquestion with the text ' a"a ' should be added

What happens:
A new subquestion with the text ' a ' is added
Additional InformationThe parsing is done 'scripts/admin/subquestions.js' with the function 'quickaddlabels'
TagsNo tags attached.
Complete LimeSurvey version number (& build)121121
I will donate to the project if issue is resolvedNo
BrowserChrome 22.0.1229.79
Database & DB-VersionMySQL 5.5.24
Operating System (Server)Ubuntu 12.04
Webserver software & versionApache
PHP Version5.4.4-9
Attached Files




damien (reporter)

Last edited: 2012-11-25 11:42

View 4 revisions

Found exactly the reason of the bug:

The parsing is right.
But when it insert the new row into the existing label table, the value is set in this manner:

value=" + value + "

So, because the value have a ' " ', we get this as a result with the string ' a"a '

So we have:
<input type="text" size="100" class="answer" value="a"a" id="answer_en_1_0" name="answer_en_1_0">

To fix this, the script need to escape the ' " '.

The user can't use the special HTML escape character &quot ; to fix this because the ";" is used by the parsing to set label code.

PS: The file is answer.js, not subquestions.js

The quick and dirty fix:

Line 614 of scripts/admin/answers.js :
Replace ...value="'+thisrow[parseInt(x)+1]+'"...
With ...value="'+thisrow[parseInt(x)+1].replace('"', '&quot ;')+'".....


I hope I helped

EDIT: I separed &quot and ; because if I join them together, the browser will show the " character.


c_schmitz (administrator)

Hello Damian,

thank you for the suggested fix. I see no general problem with it.
Since the editor for subquestions is very similar can you maybe please check out if it has the same problem and fix it there. too?

You should also in general get a GitHub account and submit the fix(es) as a pull request. Please also have a look at out standard for Git commit messages:


c_schmitz (administrator)

Any progress?


damien (reporter)

Yes, but I'm busy this week like I said in the mailing list.

The patch is done, I just need to commit it and do a correct pull request

Sorry for being so late


c_schmitz (administrator)



c_schmitz (administrator)

Damien, this was almost two weeks ago. Can you give us a status, please?


damien (reporter)

Sorry, I'm busy these days. I will attach the patch here tommorow but I think I won't have time until next week to do the pull.


mdekker (developer)

Related pull:


c_schmitz (administrator)

Sorry for the delay. Thank you very much for the patch.


c_schmitz (administrator)

Fix committed to master branch:


c_schmitz (administrator)

New version released.

+Related Changesets

-Issue History
Date Modified Username Field Change
2012-11-24 10:34 damien New Issue
2012-11-24 11:01 damien Note Added: 22477
2012-11-25 11:40 damien Note Edited: 22477 View Revisions
2012-11-25 11:40 damien Note Edited: 22477 View Revisions
2012-11-25 11:42 damien Note Edited: 22477 View Revisions
2012-11-25 15:06 Mazi Assigned To => c_schmitz
2012-11-25 15:06 Mazi Status new => assigned
2012-11-25 19:59 c_schmitz Note Added: 22489
2012-11-25 19:59 c_schmitz Assigned To c_schmitz => damien
2012-11-30 15:55 c_schmitz Note Added: 22748
2012-11-30 17:35 damien Note Added: 22759
2012-12-11 10:35 c_schmitz Note Added: 23108
2012-12-13 10:29 c_schmitz Note Added: 23210
2012-12-13 11:05 damien Note Added: 23211
2013-01-21 09:10 mdekker Note Added: 23725
2013-02-19 11:22 c_schmitz Assigned To damien => c_schmitz
2013-02-24 16:26 c_schmitz Assigned To c_schmitz => damien
2013-02-24 16:26 c_schmitz Note Added: 24226
2013-02-24 16:26 c_schmitz Status assigned => resolved
2013-02-24 16:26 c_schmitz Fixed in Version => 2.00+
2013-02-24 16:26 c_schmitz Resolution open => fixed
2013-02-24 16:26 kupec Changeset attached => LimeSurvey master 62398f9f
2013-02-24 16:26 c_schmitz Changeset attached => LimeSurvey master 1f62231a
2013-02-24 16:26 c_schmitz Note Added: 24227
2013-02-26 20:03 c_schmitz Note Added: 24413
2013-02-26 20:03 c_schmitz Status resolved => closed
+Issue History