From 3dbb8fae705df8ae31ba58b97812f007b9213d8b Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Thu, 2 Mar 2017 11:43:45 +0100 Subject: [PATCH] Added check for icon.svg [HFP-806] --- h5p.classes.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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;