diff --git a/h5p-default-storage.class.php b/h5p-default-storage.class.php index 3ea2ba9..eba4257 100644 --- a/h5p-default-storage.class.php +++ b/h5p-default-storage.class.php @@ -285,7 +285,7 @@ class H5PDefaultStorage implements \H5PFileStorage { * @return string */ public function getContent($file_path) { - return file_get_contents($this->path . $file_path); + return file_get_contents($file_path); } /** diff --git a/h5p.classes.php b/h5p.classes.php index 4b5b84c..2487a75 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;