1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 01:44:27 +02:00

MDL-75044 assignfeedback_editpdf: Add SAFER option to GS command

Adds the SAFER option to the Ghostscript command to limit interaction
with IO and OS commands
This commit is contained in:
Alex Morris 2022-06-22 19:23:48 +12:00 committed by Jenkins
parent 3cafb305de
commit aebd3576a6

@ -677,7 +677,7 @@ class pdf extends TcpdfFpdi {
$gsexec = \escapeshellarg($CFG->pathtogs);
$tempdstarg = \escapeshellarg($tempdst);
$tempsrcarg = \escapeshellarg($tempsrc);
$command = "$gsexec -q -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=$tempdstarg $tempsrcarg";
$command = "$gsexec -q -sDEVICE=pdfwrite -dSAFER -dBATCH -dNOPAUSE -sOutputFile=$tempdstarg $tempsrcarg";
exec($command);
if (!file_exists($tempdst)) {
// Something has gone wrong in the conversion.