View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
06066Bug reportsSurvey takingpublic2012-08-03 13:46
ReporterTmac Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.92+ 
Fixed in Version1.92+ 
Summary06066: File upload record damaged if user uses single quotes in comment or titles
Description

If a user uploads a file (eg. jpg) and annotates the file by adding a comment or a title, the JSON value that should get stored gets damaged/truncated if the title or comment contains a single quote (').

Steps To Reproduce

Upload a file and use a single quote in the comment or title.

TagsNo tags attached.
Attached Files
sample.jpg (13,767 bytes)   
sample.jpg (13,767 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)120418
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMySQL
Server OS (if known)Linux
Webserver software & version (if known)Apache
PHP VersionPHP Version 5.3.3-7+squeeze8

Users monitoring this issue

There are no users monitoring this issue.

Activities

TMSWhite

TMSWhite

2012-05-16 20:27

reporter   ~18796

If you upload a file and put a single quote in the title or comment, the value shown in the upload file questions looks fine. However, if you click the edit button the value shown in the pop-up window is truncated at the single quote. That is a problem with /scripts/uploader.js

However, the value stored in the database is fine (e.g. it includes the embedded single quotes).

TMSWhite

TMSWhite

2012-05-16 20:29

reporter   ~18797

So, since this is only a problem if the user tries to edit the title or comment after first setting it, downgrading this to minor.

Tmac

Tmac

2012-05-17 17:10

reporter   ~18831

[{ "title":"this's a title","comment":"this 's a comment","size":"38.366","name":"complete%20main%20bedroom%2C%20last%20curtains%20on%20the%20way.jpg","filename":"fu_3hf8exhi4hq9u4n","ext":"jpg" },{ "title":"","comment":"","size":"38.366","name":"complete%20main%20bedroom%2C%20last%20curtains%20on%20the%20way.jpg","filename":"fu_cmekbk9c22cv577","ext":"jpg" }]

In the above JSON record, both the comment and title have single quotes stored in them. The title is stored correctly but the comment has a single with an extra space in front of it. The problem is that if a person who has taken a survey and uploaded a file and then goes back to change/upload another file, the original files APPEAR to be missing (ie not displayed) even tho their record is in the database. In the sample.jpg attatched, the first image is in its own group as expected. The second group of two files looks blank but the database contains the record you see here.
Also all the other files in the third group of this particular survey are all gone and they DONT have single quotes. I think the single quote is somehow aborting the processing of the records. (Not minor in my case :-)

Tmac

Tmac

2012-05-17 17:16

reporter   ~18833

Oh and if the user then submits the survey with the 'missing images' then this is the resultant record in the database - slashes, extra spaces and then truncated at the first single quote. If he tries again, double slashes and so on...

[{ \"title\":\"this

c_schmitz

c_schmitz

2012-05-17 17:44

administrator   ~18835

Diogo, are you still at this?

c_schmitz

c_schmitz

2012-07-27 11:26

administrator   ~20018

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

c_schmitz

c_schmitz

2012-07-27 11:26

administrator   ~20019

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

Related Changesets

LimeSurvey: master 85edf573

2012-07-27 02:26:22

c_schmitz

Details Diff
Fixed issue 06066: File upload fails if single oder double quotes are used Affected Issues
06066
mod - classes/expressions/LimeExpressionManager.php Diff File
mod - scripts/uploader.js Diff File

LimeSurvey: Yii 2fd21671

2012-07-27 02:26:44

c_schmitz

Details Diff
Fixed issue 06066: File upload fails if single oder double quotes are used Affected Issues
06066
mod - application/helpers/expressions/em_manager_helper.php Diff File
mod - scripts/uploader.js Diff File

Issue History

Date Modified Username Field Change
2012-05-04 17:32 Tmac New Issue
2012-05-05 23:20 c_schmitz Assigned To => dionet
2012-05-05 23:20 c_schmitz Status new => assigned
2012-05-16 20:27 TMSWhite Note Added: 18796
2012-05-16 20:28 TMSWhite File Added: limesurvey_survey_56825.lss
2012-05-16 20:29 TMSWhite Note Added: 18797
2012-05-16 20:29 TMSWhite Assigned To dionet => TMSWhite
2012-05-16 20:30 TMSWhite Assigned To TMSWhite => dionet
2012-05-16 20:30 TMSWhite Priority high => normal
2012-05-16 20:30 TMSWhite Severity crash => minor
2012-05-17 17:03 Tmac File Added: sample.jpg
2012-05-17 17:10 Tmac Note Added: 18831
2012-05-17 17:16 Tmac Note Added: 18833
2012-05-17 17:44 c_schmitz Note Added: 18835
2012-07-27 10:31 c_schmitz Assigned To dionet => c_schmitz
2012-07-27 11:26 c_schmitz Changeset attached => LimeSurvey master 85edf573
2012-07-27 11:26 c_schmitz Note Added: 20018
2012-07-27 11:26 c_schmitz Resolution open => fixed
2012-07-27 11:26 c_schmitz Changeset attached => LimeSurvey Yii 2fd21671
2012-07-27 11:26 c_schmitz Note Added: 20019
2012-07-27 11:26 c_schmitz Status assigned => resolved
2012-07-27 11:26 c_schmitz Fixed in Version => 1.92+
2012-08-03 13:46 c_schmitz Status resolved => closed