View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
09415Bug reportsSurvey takingpublic2014-12-29 15:33
ReporterDenisChenu Assigned Toaesteban  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Summary09415: Invalid url for image broke Print to PDF with debug 2
Description

With a survey with invalid image link : you have a PHP warning when try to print in PDF for user (maybe for admin too)

Steps To Reproduce

Create a survey with an invalid url for image src, try to print with debug 2 (lss included)

Additional Information

Maybe same if image url is not an image : to be tested (404 error and filetype)

TagsNo tags attached.
Attached Files
Bug heat8
Complete LimeSurvey version number (& build)141217
I will donate to the project if issue is resolvedNo
Browsernot relevant
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP VersionPHP Version 5.4.4

Users monitoring this issue

aesteban

Activities

DenisChenu

DenisChenu

2014-12-17 11:45

developer   ~31283

@aesteban : we have to filter too (HTML or not ?) survey title : because sometimes, some user add <br /> or <img> to survey title.

aesteban

aesteban

2014-12-18 23:44

developer   ~31301

@DenisChenu: I took a look at this bug. We can fix it if we initialize $tcpdf['base_url'] to a non empty value in config/tcpdf.php but an exception is thrown in /var/www/limesurvey/application/third_party/tcpdf/tcpdf.php(2933) because the image doesn't exist (tcpdf is configured to throw exceptions). In fact, I think K_PATH_URL is useless for LimeSurvey. K_PATH_URL is usefull only if the survey creator write an image whose path contains http://yourhost.com/limesurvey/application/third_party/tcpdf/ and the only advantage is that tcpdf take image from file system instead of using curl.

So, in my opinion, we could initialize

$tcpdf['base_url'] = 'dummy'

or just do nothing. What do you think Denis?

aesteban

aesteban

2014-12-19 01:37

developer   ~31305

@DenisChenu: I have reproduced the "strpos(): Empty needle" with found images so I think I will initialize $tcpdf['base_url'] = 'dummy'.

Retarding survey title, I think HTML is better than plain text.

DenisChenu

DenisChenu

2014-12-19 08:28

developer   ~31306

I let you go for title HTML ;)

For the image : it can be great if image is taken from system (if able), but deactivate it : why not :)

aesteban

aesteban

2014-12-19 18:55

developer   ~31318

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

aesteban

aesteban

2014-12-19 18:59

developer   ~31319

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

aesteban

aesteban

2014-12-19 20:27

developer   ~31320

And I filtered survey title:

https://github.com/LimeSurvey/LimeSurvey/commit/d00c9499705ee58a3b779ffcbecc95eb2c47a7bf

DenisChenu

DenisChenu

2014-12-20 11:38

developer   ~31324

Thanks

c_schmitz

c_schmitz

2014-12-29 15:33

administrator   ~31370

Version 2.05 Build 141229 released

Related Changesets

LimeSurvey: master 1a68b626

2014-12-19 17:51:05

aesteban

Details Diff
Fixed issue 09415: Invalid url for image broke Print to PDF with debug 2 Affected Issues
09415
mod - application/config/tcpdf.php Diff File

LimeSurvey: 2.06 05d10351

2014-12-19 17:51:05

aesteban

Details Diff
Fixed issue 09415: Invalid url for image broke Print to PDF with debug 2 Affected Issues
09415
mod - application/config/tcpdf.php Diff File

Issue History

Date Modified Username Field Change
2014-12-17 11:44 DenisChenu New Issue
2014-12-17 11:44 DenisChenu Status new => assigned
2014-12-17 11:44 DenisChenu Assigned To => aesteban
2014-12-17 11:44 DenisChenu File Added: limesurvey_survey_pdfInvalidImage.lss
2014-12-17 11:45 DenisChenu Note Added: 31283
2014-12-18 23:44 aesteban Note Added: 31301
2014-12-19 00:23 aesteban Issue Monitored: aesteban
2014-12-19 01:37 aesteban Note Added: 31305
2014-12-19 08:28 DenisChenu Note Added: 31306
2014-12-19 18:55 aesteban Changeset attached => LimeSurvey master 1a68b626
2014-12-19 18:55 aesteban Note Added: 31318
2014-12-19 18:55 aesteban Resolution open => fixed
2014-12-19 18:57 aesteban Status assigned => resolved
2014-12-19 18:59 aesteban Changeset attached => LimeSurvey 2.06 05d10351
2014-12-19 18:59 aesteban Note Added: 31319
2014-12-19 20:27 aesteban Note Added: 31320
2014-12-20 11:38 DenisChenu Note Added: 31324
2014-12-29 15:33 c_schmitz Note Added: 31370
2014-12-29 15:33 c_schmitz Status resolved => closed
2021-08-03 11:51 guest Bug heat 6 => 8