mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
Merge branch 'MDL-43074-master' of git://github.com/damyon/moodle
This commit is contained in:
commit
9b4c44c8e6
1 changed files with 10 additions and 9 deletions
|
@ -426,14 +426,14 @@ class pdf extends \FPDI {
|
||||||
|
|
||||||
if ($generate) {
|
if ($generate) {
|
||||||
// Use ghostscript to generate an image of the specified page.
|
// Use ghostscript to generate an image of the specified page.
|
||||||
$gsexec = \get_config('assignfeedback_editpdf', 'gspath');
|
$gsexec = \escapeshellarg(\get_config('assignfeedback_editpdf', 'gspath'));
|
||||||
$imageres = 100;
|
$imageres = \escapeshellarg(100);
|
||||||
$filename = $this->filename;
|
$imagefilearg = \escapeshellarg($imagefile);
|
||||||
$pagenoinc = $pageno + 1;
|
$filename = \escapeshellarg($this->filename);
|
||||||
|
$pagenoinc = \escapeshellarg($pageno + 1);
|
||||||
$command = "$gsexec -q -sDEVICE=png16m -dSAFER -dBATCH -dNOPAUSE -r$imageres -dFirstPage=$pagenoinc -dLastPage=$pagenoinc ".
|
$command = "$gsexec -q -sDEVICE=png16m -dSAFER -dBATCH -dNOPAUSE -r$imageres -dFirstPage=$pagenoinc -dLastPage=$pagenoinc ".
|
||||||
"-dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=\"$imagefile\" \"$filename\"";
|
"-dGraphicsAlphaBits=4 -dTextAlphaBits=4 -sOutputFile=$imagefilearg $filename";
|
||||||
|
|
||||||
//$command = escapeshellcmd($command);
|
|
||||||
$output = null;
|
$output = null;
|
||||||
$result = exec($command, $output);
|
$result = exec($command, $output);
|
||||||
if (!file_exists($imagefile)) {
|
if (!file_exists($imagefile)) {
|
||||||
|
@ -484,9 +484,10 @@ class pdf extends \FPDI {
|
||||||
|
|
||||||
$file->copy_content_to($tempsrc); // Copy the file.
|
$file->copy_content_to($tempsrc); // Copy the file.
|
||||||
|
|
||||||
$gsexec = \get_config('assignfeedback_editpdf', 'gspath');
|
$gsexec = \escapeshellarg(\get_config('assignfeedback_editpdf', 'gspath'));
|
||||||
$command = "$gsexec -q -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=\"$tempdst\" \"$tempsrc\"";
|
$tempdstarg = \escapeshellarg($tempdst);
|
||||||
//$command = escapeshellcmd($command);
|
$tempsrcarg = \escapeshellarg($tempsrc);
|
||||||
|
$command = "$gsexec -q -sDEVICE=pdfwrite -dBATCH -dNOPAUSE -sOutputFile=$tempdstarg $tempsrcarg";
|
||||||
exec($command);
|
exec($command);
|
||||||
@unlink($tempsrc);
|
@unlink($tempsrc);
|
||||||
if (!file_exists($tempdst)) {
|
if (!file_exists($tempdst)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue