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-07-01 12:47:18 +02:00
committed by Jenkins
parent 47c211ba0e
commit c8f9140e70
+1 -1
View File
@@ -632,7 +632,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.