mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-61537 assignfeedback_editpdf: Check for existence of old test images
Since error suppression was removed with the call to unlink() to make sure that there are no previous test image files before testing for the gs path, make sure that it exists first before deleting to prevent it from throwing any errors.
This commit is contained in:
parent
00229165d4
commit
f2ad613278
@ -737,7 +737,11 @@ class pdf extends \FPDI {
|
||||
}
|
||||
|
||||
$testimagefolder = \make_temp_directory('assignfeedback_editpdf_test');
|
||||
unlink($testimagefolder . '/' . self::IMAGE_PAGE . '0.png'); // Delete any previous test images.
|
||||
$filepath = $testimagefolder . '/' . self::IMAGE_PAGE . '0.png';
|
||||
// Delete any previous test images, if they exist.
|
||||
if (file_exists($filepath)) {
|
||||
unlink($filepath);
|
||||
}
|
||||
|
||||
$pdf = new pdf();
|
||||
$pdf->set_pdf($testfile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user