Added check for icon.svg [HFP-806]

pull/38/head
Paal Joergensen 2017-03-02 11:43:45 +01:00
parent 90fd9a2a28
commit 3dbb8fae70
1 changed files with 4 additions and 5 deletions

View File

@ -721,7 +721,7 @@ class H5PValidator {
$mainH5pData = null; $mainH5pData = null;
$libraryJsonData = null; $libraryJsonData = null;
$contentJsonData = null; $contentJsonData = null;
$mainH5pExists = $imageExists = $contentExists = FALSE; $mainH5pExists = $contentExists = FALSE;
foreach ($files as $file) { foreach ($files as $file) {
if (in_array(substr($file, 0, 1), array('.', '_'))) { if (in_array(substr($file, 0, 1), array('.', '_'))) {
continue; continue;
@ -749,10 +749,6 @@ class H5PValidator {
} }
} }
} }
// Check for h5p.jpg?
elseif (strtolower($file) == 'h5p.jpg') {
$imageExists = TRUE;
}
// Content directory holds content. // Content directory holds content.
elseif ($file == 'content') { elseif ($file == 'content') {
// We do a separate skipContent check to avoid having the content folder being treated as a library // We do a separate skipContent check to avoid having the content folder being treated as a library
@ -937,6 +933,9 @@ class H5PValidator {
} }
} }
// Check for icon:
$h5pData['hasIcon'] = file_exists($filePath . DIRECTORY_SEPARATOR . 'icon.svg');
$validLibrary = $this->isValidH5pData($h5pData, $file, $this->libraryRequired, $this->libraryOptional); $validLibrary = $this->isValidH5pData($h5pData, $file, $this->libraryRequired, $this->libraryOptional);
$validLibrary = $this->h5pCV->validateContentFiles($filePath, TRUE) && $validLibrary; $validLibrary = $this->h5pCV->validateContentFiles($filePath, TRUE) && $validLibrary;