diff --git a/h5p.classes.php b/h5p.classes.php index 4ef02b1..8483bda 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -721,7 +721,7 @@ class H5PValidator { $mainH5pData = null; $libraryJsonData = null; $contentJsonData = null; - $mainH5pExists = $imageExists = $contentExists = FALSE; + $mainH5pExists = $contentExists = FALSE; foreach ($files as $file) { if (in_array(substr($file, 0, 1), array('.', '_'))) { continue; @@ -749,10 +749,6 @@ class H5PValidator { } } } - // Check for h5p.jpg? - elseif (strtolower($file) == 'h5p.jpg') { - $imageExists = TRUE; - } // Content directory holds content. elseif ($file == 'content') { // 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->h5pCV->validateContentFiles($filePath, TRUE) && $validLibrary;