View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
09458Bug reportsPrint Viewpublic2015-02-11 15:57
Reportergtrudel Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary09458: HTMLPurifier inserts ! characters at random into emailed surveys
Description

HTMLPurifier inserts ! characters at random into emailed surveys

Steps To Reproduce

Set up a survey, which has at least one question having a set of sub questions that are all short text. Submit the survey and have it email all the answers to you. The ! text will appear at random in some place.

Additional Information

Removing the call to HTMLPurifier in frontend_helper.php for the array $aReplacementVars['ANSWERTABLE'] is a workaround solution to the problem.

TagsNo tags attached.
Attached Files
response_source.txt (13,098 bytes)   
X-Priority: 3
X-Mailer: PHPMailer 5.2.8 (https://github.com/PHPMailer/PHPMailer/)
X-Surveymailer: LimeSurvey GIT master version Emailer (LimeSurvey.sourceforge.net)
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

Hello,<br /><br />
A new response was submitted for your survey 'VM Questionnaire'.<br /><br />
Click the following link to reload the survey:<br />
<br /><br />
Click the following link to see the individual response:<br />
<a href='http://limesurvey.sondages.pro/admin/responses/sa/view/surveyid/495158/id/9'>http://limesurvey.sondages.pro/admin/responses/sa/view/surveyid/495158/id/9</a><br /><br />
Click the following link to edit the individual response:<br />
<a href='http://limesurvey.sondages.pro/admin/dataentry/sa/editdata/subaction/edit/surveyid/495158/id/9'>http://limesurvey.sondages.pro/admin/dataentry/sa/editdata/subaction/edit/surveyid/495158/id/9</a><br /><br />
View statistics by clicking here:<br />
<a href='http://limesurvey.sondages.pro/admin/statistics/sa/index/surveyid/495158'>http://limesurvey.sondages.pro/admin/statistics/sa/index/surveyid/495158</a><br /><br /><br />
The following answers were given by the participant:<br />
<table class="printouttable"><tr class="printanswersquestion"><td>Response ID </td><td class="printanswersanswertext">9</td></tr><tr class="printanswersquestion"><td>Date submitted </td><td class="printanswersanswertext">01-29-2015 15:01:02</td></tr><tr class="printanswersquestion"><td>Last page </td><td class="printanswersanswertext">6</td></tr><tr class="printanswersquestion"><td>Start language </td><td class="printanswersanswertext">en</td></tr><tr class="printanswersquestion"><td>Date started </td><td class="printanswersanswertext">01-29-2015 14:59:49</td></tr><tr class="printanswersquestion"><td>Date last action </td><td class="printanswersanswertext">01-29-2015 15:01:02</td></tr><tr class="printanswersgroup"><td colspan="2">General Server Questions</td></tr><tr class="printanswersquestion"><td><strong>What name/title do you want to use to refer to this project?</strong> </td><td class="printanswersanswertext">ccxw</td></tr><tr class="printanswersquestionhead"><td colspan="2"><strong>Who is the Technical Contact for your System? </strong></td></tr><tr class="printanswersquestion"><td><strong>Who is the Technical Contact for your System? </strong> [Name]</td><td class="printanswersanswertext">cxcx</td></tr><tr class="printanswersquestion"><td><strong>Who is the Technical Contact for your System? </strong> [Title]</td><td class="printanswersanswertext">sqdqd q</td></tr><tr class="printanswersquestion"><td><strong>Who is the Technical Contact for your System? </strong> [Area]</td><td class="printanswersanswertext">dqs dqd</td></tr><tr class="printanswersquestion"><td><strong>Who is the Technical Contact for your System? </strong> [Email]</td><td class="printanswersanswertext">dqsdqsd</td></tr><tr class="printanswersquestion"><td><strong>Who is the Technical Contact for your System? </strong> [Phone]</td><td class="printanswersanswertext"> qsdqsd</td></tr><tr class="printanswersquestionhead"><td colspan="2"><strong>Who is the Business or Supervisor Contact who will sign the agreement and authorize the fund transfer? </strong><em>(Name , Title , Area , Email , Phone)</em></td></tr><tr class="printanswersquestion"><td><strong>Who is the Business or Supervisor Contact who will sign the agreement and authorize the fund transfer? </strong><em>(Name , Title , Area , Email , Phone)</em> [Name]</td><td class="printanswersanswertext">qsdqsd</td></tr><tr class="printanswersquestion"><td><strong>Who is the Business or Supervisor Contact who will sign the agreement and authorize the fund transfer? </strong><em>(Name , Title , Area , Email , Phone)</em> [Title]</td><td class="printanswersanswertext">qs dqsd</td></tr><tr class="printanswersquestion"><td><strong>Who is the Business or Supervisor Contact who will sign the agreement and authorize the fund transfer? </strong><em>(Name , Title , Area , Email , Phone)</em> [Area]</td><td class="printanswersanswertext">sqdqsd</td></tr><tr class="printanswersquestion"><td><strong>Who is the Business or Supervisor Contact who will sign the agreement and authorize the fund transfer? </strong><em>(Name , Title , Area , Email , Phone)</em> [Email]</td><td class="printanswersanswertext">sqdqs d</td></tr><tr class="printanswersquestion"><td><strong>Who is the Business or Supervisor Contact who will sign the agreement and authorize the fund transfer? </strong><em>(Name , Title , Area , Email , Phone)</em> [Phone]</td><td class="printanswersanswertext">qsd q</td></tr><tr class="printanswersquestion"><td><strong>The department/area this system will be associated with?</strong> </td><td class="printanswersanswertext">sqdqsdqs d</td></tr><tr class="printanswersquestion"><td><strong>Account String that will be used to pay for this service?</strong> </td><td class="printanswersanswertext">sqdqsdq</td></tr><tr class="printanswersgroup"><td colspan="2">Specific Server Questions</td></tr><tr class="printanswersquestion"><td><strong>Is there a specific name for this server that you’d like to request?</strong> </td><td class="printanswersanswertext">qsdqsdqs</td></tr><tr class="printanswersquestion"><td><strong>Is this server replacing an existing server? </strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersgroup"><td colspan="2">Server Specifications</td></tr><tr class="printanswersquestion"><td>What is the OS? </td><td class="printanswersanswertext">Linux [A2]</td></tr><tr class="printanswersquestion"><td>What is the CPU? </td><td class="printanswersanswertext">sqddqs</td></tr><tr class="printanswersquestion"><td>What is the amount of RAM needed? </td><td class="printanswersanswertext">100 MB [A1]</td></tr><tr class="printanswersquestion"><td><strong>What is the amount of storage needed?</strong> <em>(not including OS)</em> </td><td class="printanswersanswertext">20 GB [A2]</td></tr><tr class="printanswersquestion"><td><strong>Do you need a standard OS install or will this server be a virtual appliance?</strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestion"><td><strong>Is this an Enterprise Level System or have a Latency-Sensitive Workload?  </strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestion"><td><strong>Do you want this system backed up?</strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestion"><td><strong>Do you need Disaster Recovery Services for this system? </strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestion"><td><strong>What Admin Support Level &amp; Monitoring Level do you need for this server? </strong> </td><td class="printanswersanswertext">Low (email only) [A2]</td></tr><tr class="printanswersquestion"><td>Feature </td><td class="printanswersanswertext">MS SQL Small [A1]</td></tr><tr class="printanswersquestion"><td>Operating System </td><td class="printanswersanswertext">Windows 2012 64 bit [A1]</td></tr><tr class="printanswersquestion"><td>Instance </td><td class="printanswersanswertext">r3.xlarge [A3]</td></tr><tr class="printanswersquestion"><td>Drive Layout </td><td class="printanswersanswertext">Drive H: 50 [A6]</td></tr><tr class="printanswersgroup"><td colspan="2">Server Specifications - continued</td></tr><tr class="printanswersquestion"><td><strong>Is a database part of your system?  </strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestionhead"><td colspan="2"><strong>Names and UserIDs  for those who will need access to the Server </strong></td></tr><tr class="printanswersquestion"><td><strong>Names and UserIDs  for those who will need access to the Server </strong> [Admin Level Access:]</td><td class="printanswersanswertext">dsqdsq</td></tr><tr class="printanswersquestion"><td><strong>Names and UserIDs  for those who will need access to the Server </strong> [General Access Users:]</td><td class="printanswersanswertext">sqddsq</td></tr><tr class="printanswersquestion"><td><strong>Is this new server part of a group of servers with identical function?</strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestion"><td><strong>Is this server part of a larger set of servers that will all have the same access list of users and access levels?</strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersgroup"><td colspan="2">Server Specifications - final questions</td></tr><tr class="printanswersquestion"><td><strong>How will you be connecting your server to do Admin services?  (SSH, RDP, VPN, etc.)  </strong> </td><td class="printanswersanswertext">sqddsqdsq</td></tr><tr class="printanswersquestion"><td><strong>What IP address or network will you be on when you are using your Admin access rights? (i.e. 130.127.5.111, or Clemson VPN, or Lee Hall, etc.)</strong> </td><td class="printanswersanswertext">sqddsqdsq</td></tr><tr class="printanswersquestion"><td><strong>Networks: Will your system need to be accessed by anyone or any system outside of the Clemson network? </strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestion"><td><strong>Ports: Are there any specific ports you will need opened for a specific Admin Tool you will use on your server?</strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestion"><td><strong>If known, is there a specific VLAN or Network this server should be added to?</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Does your system need to be configured for shibboleth authentication/authorization for htaccess files?</strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestion"><td><strong>Will any vendor be configuring your server for your specific software product after the initial OS installation is complete?  </strong><em>(If yes, they will need a VPN account)</em> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestionhead"><td colspan="2"><strong>For any 3<sup>rd</sup> party software application that will run on your system, who is the Application On-Call contact person responsible for starting, running and tuning the application?</strong><br /><em>(Name, Title, Phone, Email)</em></td></tr><tr class="printanswersquestion"><td><strong>For any 3<sup>rd</sup> party software application that will run on your system, who is the Application On-Call contact person responsible for starting, running and tuning the application?</strong><br /><em>(Name, Title, Phone, Email)</em> [Name]</td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>For any 3<sup>rd</sup> party software application that will run on your system, who is the Application On-Call contact person responsible for starting, running and tuning the application?</strong><br /><em>(Name, Title, Phone, Email)</em> [Title]</td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>For any 3<sup>rd</sup> party software application that will run on your system, who is the Application On-Call contact person responsible for starting, running and tuning the application?</strong><br /><em>(Name, Title, Phone, Email)</em> [Phone]</td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>For any 3<sup>rd</sup> party software application that will run on your system, who is the Application On-Call contact person responsible for starting, running and tuning the application?</strong><br /><em>(Name, Title, Phone, Email)</em> [Email]</td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Will you need Application Level Monitoring beyond just System Monitoring? </strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersgroup"><td colspan="2">Final questions</td></tr><tr class="printanswersquestion"><td><strong>Please describe the data that will be stored or used by this system. </strong> </td><td class="printanswersanswertext">sqdsq dqsdqsdqsd
qsdqs
d
qsd
qs</td></tr><tr class="printanswersquestion"><td><strong>Â Is this data regulated, confidential or considered sensitive in any way?</strong> </td><td class="printanswersanswertext">No [N]</td></tr><tr class="printanswersquestion"><td><strong>Please list any dependencies on other servers that this system will need, such as access to other servers for data exchange (i.e. Databases, etc.)</strong> </td><td class="printanswersanswertext">dqsdqsdqs
dqs d
qsd
qs
d
q</td></tr><tr class="printanswersquestion"><td><strong>Please provide a brief description of what this system will be used for:</strong> </td><td class="printanswersanswertext">qsdsqdqs d sq
d
qsd
qs
dq</td></tr></table>


response_source.txt (13,098 bytes)   
email.txt (9,252 bytes)   
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">Hello,<br>
<br>
A new response was submitted for your survey 'VMWare Request'.<br>
<br>
Click the following link to reload the survey:<br>
<br>
<br>
Click the following link to see the individual response:<br>
<a href="http://localhost/vm/trunk/index.php/admin/responses/sa/view/surveyid/423489/id/13">http://localhost/vm/trunk/index.php/admin/responses/sa/view/surveyid/423489/id/13</a><br>
<br>
Click the following link to edit the individual response:<br>
<a href="http://localhost/vm/trunk/index.php/admin/dataentry/sa/editdata/subaction/edit/surveyid/423489/id/13">http://localhost/vm/trunk/index.php/admin/dataentry/sa/editdata/subaction/edit/surveyid/423489/id/13</a><br>
<br>
View statistics by clicking here:<br>
<a href="http://localhost/vm/trunk/index.php/admin/statistics/sa/index/surveyid/423489">http://localhost/vm/trunk/index.php/admin/statistics/sa/index/surveyid/423489</a><br>
<br>
<br>
The following answers were given by the participant:<br>
<table class="printouttable"><tr class="printanswersquestion"><td>Response ID </td><td class="printanswersanswertext">13</td></tr><tr class="printanswersquestion"><td>Date submitted </td><td class="printanswersanswertext">01-29-2015 16:47:59</td></tr><tr class="printanswersquestion"><td>Last page </td><td class="printanswersanswertext">5</td></tr><tr class="printanswersquestion"><td>Start language </td><td class="printanswersanswertext">en</td></tr><tr class="printanswersgroup"><td colspan="2">Project Basic Info</td></tr><tr class="printanswersquestion"><td><strong>What name/title do you want to use to refer to this project?</strong> </td><td class="printanswersanswertext">x</td></tr><tr class="printanswersquestionhead"><td colspan="2"><strong>Who is the Technical Contact for your System? </strong></td></tr><tr class="printanswersquestion"><td> [First Name] </td><td class="printanswersanswertext">x</td></tr><tr class="printanswersquestion"><td> [Last Name] </td><td class="pr!
 intanswersanswertext">x</td></tr><tr class="printanswersquestion"><td> [Title] </td><td class="printanswersanswertext">x</td></tr><tr class="printanswersquestion"><td> [Area] </td><td class="printanswersanswertext">x</td></tr><tr class="printanswersquestion"><td> [Email] </td><td class="printanswersanswertext">x@y.com</td></tr><tr class="printanswersquestion"><td> [Phone ] </td><td class="printanswersanswertext">1111111111</td></tr><tr class="printanswersquestionhead"><td colspan="2"><strong><strong>Who is the Business or Supervisor Contact who will sign the agreement and authorize the fund transfer?&nbsp; </strong></strong><br></td></tr><tr class="printanswersquestion"><td> [First Name] </td><td class="printanswersanswertext">x</td></tr><tr class="printanswersquestion"><td> [Last Name] </td><td class="printanswersanswertext">x</td></tr><tr class="printanswersquestion"><td> [Title] </td><td class="printanswersanswertext">x</td></tr><tr class="printanswersquestion"><td> [Area]!
  </td><td class="printanswersanswertext">x</td></tr><tr class="printan
swersquestion"><td> [Email] </td><td class="printanswersanswertext">x@y.com</td></tr><tr class="printanswersquestion"><td> [Phone ] </td><td class="printanswersanswertext">1111111111</td></tr><tr class="printanswersquestion"><td><strong>What is the department/area this system will be associated with?</strong> </td><td class="printanswersanswertext">x</td></tr><tr class="printanswersquestion"><td><strong>What is the Account String that will be used to pay for this service?</strong> </td><td class="printanswersanswertext">x</td></tr><tr class="printanswersgroup"><td colspan="2">Server Information</td></tr><tr class="printanswersquestion"><td><strong>Is there a specific name for this server that you’d like to request?</strong><br><em>(ex. HHS&nbsp; for hhs.clemson.edu)</em> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><p>
	<strong>Is this server replacing an existing server? </strong></p>
 </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Server Specification: Feature</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Do you need a standard OS install or will this server be a virtual appliance? </strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Is this an Enterprise Level System or have a Latency-Sensitive Workload?</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Do you want this system backed up? </strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Do you need Disaster Recovery Services for this system? </strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>What Admin Support Level &amp; Monitoring Level do you need for this server?</strong> </td><td cla!ss="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Is a database part of your system?</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Is this new server part of a group of servers with identical function?</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Is this server part of a larger set of servers that will all have the same access list of users and access levels?</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>How will you be connecting your server to do Admin services? </strong>(SSH, RDP, VPN, etc.)&nbsp;  </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>What IP address or network will you be on when you are using your Admin access rights? (i.e. 130.127.5.111, or Clemson VPN, or Lee Hall, etc.)</strong> </td><td class="printanswersan!
 swertext"></td></tr><tr class="printanswersgroup"><td colspan="2">Serv
er Access</td></tr><tr class="printanswersquestion"><td><strong>Admin Access Users</strong>: </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>General Access Users:</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersgroup"><td colspan="2">Networks &amp; Ports</td></tr><tr class="printanswersquestion"><td><strong>Will your system need to be accessed by anyone or any system outside of the Clemson network? </strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Are there any specific ports you will need opened for a specific Admin Tool you will use on your server?</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>If known, is there a specific VLAN or Network this server should be added to?</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersgroup"><td colspan="2">Configura!
 tion &amp; Monitoring</td></tr><tr class="printanswersquestion"><td><strong>Does your system need to be configured for shibboleth authentication/authorization for htaccess files?</strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Will any vendor be configuring your server for your specific software product after the initial OS installation is complete?&nbsp; </strong><em>(If yes, they will need a VPN account)</em> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestionhead"><td colspan="2"><strong>For any 3<sup>rd</sup> party software application that will run on your system, who is the Application On-Call contact person responsible for starting, running and tuning the application?</strong></td></tr><tr class="printanswersquestion"><td> [First Name] </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td> [Last Name] </td><td class="printanswersanswertext"></td></tr><tr! class="printanswersquestion"><td> [Title] </td><td class="printanswer
sanswertext"></td></tr><tr class="printanswersquestion"><td> [Email] </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td> [Phone] </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td><strong>Will you need Application Level Monitoring beyond just System Monitoring? </strong> </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestionhead"><td colspan="2"><strong>Who is the point of contact to assist the monitoring team with application level monitoring? </strong><br></td></tr><tr class="printanswersquestion"><td> [First Name:] </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td> [Last Name:] </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td> [Title:] </td><td class="printanswersanswertext"></td></tr><tr class="printanswersquestion"><td> [Email:] </td><td class="printanswersanswertext"></td></tr><tr class="printans!
 wersquestion"><td> [Phone:] </td><td class="printanswersanswertext"></td></tr></table>

email.txt (9,252 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)141229
I will donate to the project if issue is resolvedNo
BrowserChrome 39.0.2171.95 m
Database type & versionMySQL 5.0.11
Server OS (if known)Windows 7 Enterprise
Webserver software & version (if known)Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9
PHP Version5.5.9

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2015-01-29 12:35

developer   ~31540

I can't reproduce with included survey and last GIT version.

Upload HTML source of a test and eml file.

c_schmitz

c_schmitz

2015-01-29 14:14

administrator   ~31542

Instead of the full Purifier shebang, can't you just strip Javascript? There is a function in common_helper for that.

DenisChenu

DenisChenu

2015-01-29 16:03

developer   ~31552

Last edited: 2015-01-29 16:07

stripJavascript don't strip : onload, onhover .... etc ...

And if a question text are < p > not closed tag
Or "some text < /td >"
This break HTML of the table

Alternative is to strip tags when construction table.

gtrudel

gtrudel

2015-01-29 22:43

reporter   ~31557

Just so we are clear, the issue is not with stripping anything from the survey questions, the issue is with the insertion of a '!' character at a random place in the email text. Since this is only within an email and it is from the questions answered by the user, there is very little chance that there is any kind of malicious code in there, intentional or not. Thus, the cleanest solution for us is to simply not call HTMLPurifier at all. We simply cannot afford to have any random characters in our emails, and attempting to strip them out after the fact would be extremely difficult.

gtrudel

gtrudel

2015-01-29 22:57

reporter   ~31558

Uploaded the PDF, Outlook, and text versions of the questionnaire answers for your review. There are 2 ! characters inserted in 2 different places in the file as well as a random space character breaking up the word "Server". That makes 3 random characters inserted into the email, not including ones we might not be able to see.

DenisChenu

DenisChenu

2015-01-30 08:21

developer   ~31562

Last edited: 2015-01-30 08:25

Strange in text : there are ! in a class ????
PS: there are an invisible character in some of question text. I look for this (if we can remove it easily).

gtrudel

gtrudel

2015-01-30 15:08

reporter   ~31573

Last edited: 2015-01-30 15:09

If there are any special characters in the question text, why would removing the call to HTMLPurifier not make the email text appear strange? Again, removing the call to HTMLPurifier fixes the problem, and leaving it in causes these random characters to appear. The problem is in HTMLPurifier. Please can you look there to see how the characters could be inserted? Note also that it does the inserts at random, which means the exact same survey answered in the exact same manner will have the ! character(s) inserted at different places.

DenisChenu

DenisChenu

2015-01-30 15:10

developer   ~31574

Last edited: 2015-01-30 15:11

For the reason of HTML purifier : http://bugs.limesurvey.org/view.php?id=9201

encode user answer
purify question text

PS: AND i can not reproduce the problem. Don't find how exactly the problem happen don't fix the problem really.

DenisChenu

DenisChenu

2015-02-02 14:39

developer   ~31590

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

DenisChenu

DenisChenu

2015-02-02 14:48

developer   ~31591

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

DenisChenu

DenisChenu

2015-02-02 14:49

developer   ~31592

I really don't find how you can have ! in your table. But using strip_tags is more secure and speed. HTML is not really needed in response table.

gtrudel

gtrudel

2015-02-02 14:49

reporter   ~31593

I understand you are having problem reproducing the problem, but I do not understand your comment "Don't find how exactly the problem happen don't fix the problem really." Then you apply a fix? What fix did you apply if you say, as I think you are saying, that my fix does not fix the problem? I have provided proof that the problem is in HTMLPurifier by providing samples of the email and survey when it is in. When it is removed, the random characters disappear. How does this not fix the problem?
I understand the reasoning behind having it there, but when it corrupts the email, we cannot have it and therefore, must remove it. I was hoping someone could fix the code in HTMLPurifier that is causing the corruption?

DenisChenu

DenisChenu

2015-02-02 14:53

developer   ~31594

@gtrudel : The last fix fix the issue : no htmlPurifier, but strip_tags.

But if you have an issue for this , i don't understand why you don't have issue elsewhere.

Again : i can't reproduce the htmlPurifier 'bug' and there is no report of such bug in html purifier website (or i don't find it).

I think it can be due to a configuration in your server somewhere.

gtrudel

gtrudel

2015-02-02 15:05

reporter   ~31595

I doubt the problem has to do with our server config, since removal of the call to HTMLPurifier solves the problem. The issue, plain and simple, is the code in HTMLPurifier is inserting random characters into the email text. Solution is either to remove the call to HTMLPurifier altogether (which we have done, and works perfectly), or else make the fix to HTMLPurifier so it does not insert the characters in the first place.
Since this is a simple survey, we do not expect, nor do we care, about any strange code being entered by users: what they enter will be displayed in their email, exactly as they entered it. Why would we want to mess with it in the first place? It is an email sent back to them displaying their answers. What could be harmful about that? I do not understand the reasoning behind using HTMLPurifier or strip_tags in this place in the code.
So, bottom line, we will not make the call to HTMLPurifier, or strip_tags, or anything else that may alter the questions or answers. Thus, we will not be taking your fix. Thank you for your time.

DenisChenu

DenisChenu

2015-02-02 15:29

developer   ~31596

Last edited: 2015-02-02 15:31

Hi

You have some ! in your email.
I don't have ! in my email with the same survey
No know issue with ! with html purifier : http://htmlpurifier.org/
Then there are specific issue with your server, maybe it's all windows 2008 server. Don't know.

Issue is fixed in next release with strip_tags

PS: Maybe you use LimeSUrvey like this : only send to admin user and no complex HTML in your question. But some user have : Big picture, array, vidéo etc .... in question text, and sometimes email is send to 10 or more other users.

gtrudel

gtrudel

2015-02-02 15:33

reporter   ~31597

Why would you want to apply strip_tags (or HTMLPurifier) to survey questions and answers being sent in an email to the survey respondent in the first place? I know what they do and what they are for, but it does not make sense (to me) in this context. Can you please explain?

DenisChenu

DenisChenu

2015-02-02 16:01

developer   ~31599

Last edited: 2015-02-02 16:06

PS: Maybe you use LimeSUrvey like this : only send to admin user and no complex HTML in your question. But some user have : Big picture, array, vidéo[*] etc .... in question text, and sometimes email is send to 10 or more other users.

PS2: you can create a new plugin using afterSurveySubmit if you need.

  • ANd javascript ...
gtrudel

gtrudel

2015-02-02 16:08

reporter   ~31600

Response to PS: There is no complex HTML in our questions, apart from perhaps the validation of email addresses and phone numbers. We do not have the ability for users to enter any multimedia: they are very simple questions (i.e. text, select list, radio button) which you would see if you were to open up the survey or any of the supplied attachments. We are only sending the email to the admin user.

Response to PS2: We have no need of a custom plug in after SurveySubmit: the current code works fine (minus the HTMLPurifier call).

c_schmitz

c_schmitz

2015-02-02 16:13

administrator   ~31601

Last edited: 2015-02-02 16:14

Hello Grant,

in case you did not notice - most of us are busy with LimeSurvey in our spare time as volunteers. So if we do not match your expectations for free bug fixing support (for a free product), there is no need to be rude here.

Sometimes the implications of procedures are wider than the average user/coder can see, there is obviously a reason why we originally implemented the HTML purifier (the corresponding issue is linked to the issue , btw).

Questions and answers can contain unwanted tags inserted by an admin/survey participant.
These are properly removed using strip_tags.

HTMLPurifier is a very complex 3rd party library. It relies heavily on PHP/system close functions. That it won't work properly with your system and cannot reproduced with ours could still be tied to your system, for example to your specifc PHP version which (for example) may have a bug in one of these functions.

Anyway, I think considering our efforts to help you for free on an issue nobody but you can reproduce (and several team members tried here) I think a respectful and polite communication is key component here.

gtrudel

gtrudel

2015-02-02 16:27

reporter   ~31603

Hello c_schmitz (sorry, but I do not know your name),
My apologies if I came across as being rude. I can see how that could come about, and I am truly sorry. I realize most of you are volunteers trying to make the product better, and I greatly appreciate your time and effort in doing so. For that, I am very appreciative and grateful.

We are on the same team here: trying to make LimeSurvey into a better product for all, and I hope some of my comments may help towards that end.

For us, the insertion of random characters into the respondents survey had to be fixed, and the removal of the call to HTMLPurifier solved it. This may or may not help others: as you say, it could be a server issue or something related to our particular setup. It also never happens in the same manner twice.

In the end, we could not see the value in keeping the call to it or to anything else that would change the questions or answers, so we are keeping it out. We, like you, are also busy and cannot afford the time and effort it takes to find out exactly why this is occurring and therefore, this easy fix was applied.

Again, my apologies for any rudeness on my part, or any sign of disrespect. I hope we can continue to work together on this and other issues for the benefit of others. Thank you for your time and attention!
-Grant

c_schmitz

c_schmitz

2015-02-11 15:57

administrator   ~31659

Version 2.05 Build 150211 released

Related Changesets

LimeSurvey: master 77ae8e38

2015-02-02 13:39:02

DenisChenu

Details Diff
Fixed issue 09458: Under specific condition : HTMLPurifier inserts ! characters at random into emailed surveys
Dev: No need complete HTML for answer table . Maybe just have question code can be better.
Affected Issues
09458
mod - application/helpers/frontend_helper.php Diff File

LimeSurvey: 2.06 f64bd816

2015-02-02 13:48:15

DenisChenu

Details Diff
Fixed issue 09458: Under specific condition : HTMLPurifier inserts ! characters at random into emailed surveys
Dev: No need complete HTML for answer table . Maybe just add question code before question text can be better.
Affected Issues
09458
mod - application/helpers/frontend_helper.php Diff File

Issue History

Date Modified Username Field Change
2015-01-14 18:29 gtrudel New Issue
2015-01-14 18:29 gtrudel File Added: limesurvey_survey_495158.lss
2015-01-29 12:02 c_schmitz Assigned To => c_schmitz
2015-01-29 12:02 c_schmitz Status new => assigned
2015-01-29 12:20 c_schmitz Assigned To c_schmitz => DenisChenu
2015-01-29 12:35 DenisChenu Note Added: 31540
2015-01-29 12:35 DenisChenu File Added: response_source.txt
2015-01-29 12:35 DenisChenu File Added: Response submission for survey VM Questionnaire with results.eml
2015-01-29 14:14 c_schmitz Note Added: 31542
2015-01-29 16:03 DenisChenu Note Added: 31552
2015-01-29 16:04 DenisChenu Note Edited: 31552
2015-01-29 16:04 DenisChenu Note Edited: 31552
2015-01-29 16:06 DenisChenu Note Edited: 31552
2015-01-29 16:07 DenisChenu Note Edited: 31552
2015-01-29 22:43 gtrudel Note Added: 31557
2015-01-29 22:49 gtrudel File Added: Response submission for survey VMWare Request with results.msg
2015-01-29 22:51 gtrudel File Added: vmware-request-423489 (1).pdf
2015-01-29 22:53 gtrudel File Added: email.txt
2015-01-29 22:57 gtrudel Note Added: 31558
2015-01-30 08:21 DenisChenu Note Added: 31562
2015-01-30 08:25 DenisChenu Note Edited: 31562
2015-01-30 15:08 gtrudel Note Added: 31573
2015-01-30 15:09 gtrudel Note Edited: 31573
2015-01-30 15:10 DenisChenu Note Added: 31574
2015-01-30 15:11 DenisChenu Note Edited: 31574
2015-02-02 14:39 DenisChenu Changeset attached => LimeSurvey master 77ae8e38
2015-02-02 14:39 DenisChenu Note Added: 31590
2015-02-02 14:39 DenisChenu Resolution open => fixed
2015-02-02 14:48 DenisChenu Changeset attached => LimeSurvey 2.06 f64bd816
2015-02-02 14:48 DenisChenu Note Added: 31591
2015-02-02 14:49 DenisChenu Note Added: 31592
2015-02-02 14:49 DenisChenu Status assigned => closed
2015-02-02 14:49 DenisChenu Fixed in Version => 2.05+
2015-02-02 14:49 DenisChenu Status closed => feedback
2015-02-02 14:49 DenisChenu Resolution fixed => reopened
2015-02-02 14:49 gtrudel Note Added: 31593
2015-02-02 14:49 gtrudel Status feedback => assigned
2015-02-02 14:50 DenisChenu Status assigned => resolved
2015-02-02 14:50 DenisChenu Resolution reopened => fixed
2015-02-02 14:53 DenisChenu Note Added: 31594
2015-02-02 15:05 gtrudel Note Added: 31595
2015-02-02 15:29 DenisChenu Note Added: 31596
2015-02-02 15:31 DenisChenu Note Edited: 31596
2015-02-02 15:33 gtrudel Note Added: 31597
2015-02-02 16:01 DenisChenu Note Added: 31599
2015-02-02 16:06 DenisChenu Note Edited: 31599
2015-02-02 16:08 gtrudel Note Added: 31600
2015-02-02 16:13 c_schmitz Note Added: 31601
2015-02-02 16:14 c_schmitz Note Edited: 31601
2015-02-02 16:27 gtrudel Note Added: 31603
2015-02-11 15:57 c_schmitz Note Added: 31659
2015-02-11 15:57 c_schmitz Status resolved => closed