From c8f9140e707dcd620d31da938e2b16f779738fb0 Mon Sep 17 00:00:00 2001 From: Alex Morris Date: Wed, 22 Jun 2022 19:32:31 +1200 Subject: [PATCH] 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 --- mod/assign/feedback/editpdf/classes/pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/assign/feedback/editpdf/classes/pdf.php b/mod/assign/feedback/editpdf/classes/pdf.php index c3b6921088c..e592bc382ae 100644 --- a/mod/assign/feedback/editpdf/classes/pdf.php +++ b/mod/assign/feedback/editpdf/classes/pdf.php @@ -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.