View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
06946Bug reportsSurvey editingpublic2013-02-26 20:03
Reporterdamien Assigned Todamien  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary06946: "Quick-add" fail to parse expressions with ' " '
Description

The "Quick-add" feature in the label set / subquestions editor fail to parse expressions with ' " ' (a quotation mark).

Steps To Reproduce
  1. 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 Information

The parsing is done 'scripts/admin/subquestions.js' with the function 'quickaddlabels'

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)121121
I will donate to the project if issue is resolvedNo
BrowserChrome 22.0.1229.79
Database type & versionMySQL 5.5.24
Server OS (if known)Ubuntu 12.04
Webserver software & version (if known)Apache
PHP Version5.4.4-9

Users monitoring this issue

damien

Activities

damien

damien

2012-11-24 11:01

reporter   ~22477

Last edited: 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.

c_schmitz

c_schmitz

2012-11-25 19:59

administrator   ~22489

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

c_schmitz

c_schmitz

2012-11-30 15:55

administrator   ~22748

Any progress?

damien

damien

2012-11-30 17:35

reporter   ~22759

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

c_schmitz

2012-12-11 10:35

administrator   ~23108

?

c_schmitz

c_schmitz

2012-12-13 10:29

administrator   ~23210

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

damien

damien

2012-12-13 11:05

reporter   ~23211

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

mdekker

2013-01-21 09:10

reporter   ~23725

Related pull: https://github.com/LimeSurvey/LimeSurvey/pull/64

c_schmitz

c_schmitz

2013-02-24 16:26

administrator   ~24226

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

c_schmitz

c_schmitz

2013-02-24 16:26

administrator   ~24227

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

c_schmitz

c_schmitz

2013-02-26 20:03

administrator   ~24413

New version released.

Related Changesets

LimeSurvey: master 62398f9f

2012-12-15 11:14

user22540


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

LimeSurvey: master 1f62231a

2013-02-24 16:25

c_schmitz


Details Diff
Merge pull request #64 from MDamien/master

Fixed issue 06946: "Quick-add" fail to parse expressions with ' " '
Affected Issues
06946
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
2012-11-25 11:40 damien Note Edited: 22477
2012-11-25 11:42 damien Note Edited: 22477
2012-11-25 12:50 damien Issue Monitored: damien
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 user22540 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
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing
2021-08-04 18:27 guest Bug heat 6 => 8