pull/38/head
thomasmars 2017-03-02 12:49:45 +01:00
commit 16228b3086
2 changed files with 5 additions and 6 deletions

View File

@ -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);
}
/**

View File

@ -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;