From: <gem...@li...> - 2012-05-31 09:12:02
|
Revision: 713 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=713&view=rev Author: michieltcs Date: 2012-05-31 09:11:51 +0000 (Thu, 31 May 2012) Log Message: ----------- Use escapeshellarg() to escape the command, delete temp files before throwing exception Modified Paths: -------------- trunk/library/classes/Gems/Default/RespondentExportAction.php Modified: trunk/library/classes/Gems/Default/RespondentExportAction.php =================================================================== --- trunk/library/classes/Gems/Default/RespondentExportAction.php 2012-05-31 08:11:00 UTC (rev 712) +++ trunk/library/classes/Gems/Default/RespondentExportAction.php 2012-05-31 09:11:51 UTC (rev 713) @@ -111,10 +111,13 @@ file_put_contents($tempInputFilename, $content); - $lastLine = exec(escapeshellcmd($this->_wkhtmltopdfLocation) . ' ' . escapeshellarg($tempInputFilename) + $lastLine = exec(escapeshellarg($this->_wkhtmltopdfLocation) . ' ' . escapeshellarg($tempInputFilename) . ' ' . escapeshellarg($tempOutputFilename), $outputLines, $return); if ($return > 0) { + @unlink($tempInputFilename); + @unlink($tempOutputFilename); + throw new Exception(sprintf($this->_('Unable to run PDF conversion: "%s"'), $lastLine)); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |