Skip to content

Commit

Permalink
MDL-75044 assignfeedback_editpdf: Add SAFER option to GS command
Browse files Browse the repository at this point in the history
Adds the SAFER option to the Ghostscript command to limit interaction
with IO and OS commands
  • Loading branch information
alexmorrisnz authored and Jenkins committed Jul 6, 2022
1 parent 3cafb30 commit aebd357
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mod/assign/feedback/editpdf/classes/pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ public static function ensure_pdf_file_compatible($tempsrc) {
$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.
Expand Down

0 comments on commit aebd357

Please sign in to comment.