Merge branch 'CheckFileExistsBeforeZip' of https://github.com/mannes/h5p-php-library into mannes-CheckFileExistsBeforeZip

pull/10/merge
thomasmars 2017-04-18 10:44:37 +02:00
commit d4c90e716d
1 changed files with 3 additions and 1 deletions

View File

@ -1610,7 +1610,9 @@ Class H5PExport {
foreach ($files as $file) { foreach ($files as $file) {
// Please note that the zip format has no concept of folders, we must // Please note that the zip format has no concept of folders, we must
// use forward slashes to separate our directories. // use forward slashes to separate our directories.
$zip->addFile(realpath($file->absolutePath), $file->relativePath); if (file_exists(realpath($file->absolutePath))) {
$zip->addFile(realpath($file->absolutePath), $file->relativePath);
}
} }
// Close zip and remove tmp dir // Close zip and remove tmp dir