LimeSurvey issue tracker
Registration

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
06946Bug reports[All Projects] Survey designpublic2012-11-24 10:342013-02-26 20:03
Reporterdamien 
Assigned Todamien 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
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'
I will donate to the project if issue is resolved within 48 hrsNo
LimeSurvey build number OR git commit ID121121
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

- Relationships

-  Notes
User avatar (22477)
damien (developer)
2012-11-24 11:01
edited on: 2012-11-25 11:42

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.

User avatar (22489)
c_schmitz (administrator)
2012-11-25 19:59

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: http://docs.limesurvey.org/Standard+for+Git+commit+messages&structure=LimeSurvey+development [^]
User avatar (22748)
c_schmitz (administrator)
2012-11-30 15:55

Any progress?
User avatar (22759)
damien (developer)
2012-11-30 17:35

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
User avatar (23108)
c_schmitz (administrator)
2012-12-11 10:35

?
User avatar (23210)
c_schmitz (administrator)
2012-12-13 10:29

Damien, this was almost two weeks ago. Can you give us a status, please?
User avatar (23211)
damien (developer)
2012-12-13 11:05

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.
User avatar (23725)
mdekker (developer)
2013-01-21 09:10

Related pull: https://github.com/LimeSurvey/LimeSurvey/pull/64 [^]
User avatar (24226)
c_schmitz (administrator)
2013-02-24 16:26

Sorry for the delay. Thank you very much for the patch.
User avatar (24227)
c_schmitz (administrator)
2013-02-24 16:26

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=11681 [^]
User avatar (24413)
c_schmitz (administrator)
2013-02-26 20:03

New version released.

- Related Changesets
LimeSurvey: master 62398f9f
Timestamp: 2012-12-15 10:14:25
Author: kupec
Committer: Damien
Details ] Diff ]
Fixed issue 06946: "Quick-add" fail to parse expressions with ' " '
mod - scripts/admin/answers.js Diff ] File ]
LimeSurvey: master 1f62231a
Timestamp: 2013-02-24 15:25:16
Author: c_schmitz
Committer: Carsten Schmitz
Details ] Diff ]
Merge pull request #64 from MDamien/master

Fixed issue 06946: "Quick-add" fail to parse expressions with ' " '
mod - scripts/admin/answers.js Diff ] File ]

- 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


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker