Merge branch 'whitelist'

namespaces
Svein-Tore Griff With 2014-11-01 12:57:15 +01:00
commit a97a8d296c
1 changed files with 5 additions and 1 deletions

View File

@ -1526,9 +1526,9 @@ class H5PCore {
public static $defaultContentWhitelist = 'json png jpg jpeg gif bmp tif tiff svg eot ttf woff otf webm mp4 ogg mp3 txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile'; public static $defaultContentWhitelist = 'json png jpg jpeg gif bmp tif tiff svg eot ttf woff otf webm mp4 ogg mp3 txt pdf rtf doc docx xls xlsx ppt pptx odt ods odp xml csv diff patch swf md textile';
public static $defaultLibraryWhitelistExtras = 'js css'; public static $defaultLibraryWhitelistExtras = 'js css';
public $librariesJsonData, $contentJsonData, $mainJsonData, $h5pF, $path, $development_mode, $h5pD, $disableFileCheck;
const SECONDS_IN_WEEK = 604800; const SECONDS_IN_WEEK = 604800;
public $librariesJsonData, $contentJsonData, $mainJsonData, $h5pF, $path, $development_mode, $h5pD;
private $exportEnabled; private $exportEnabled;
/** /**
@ -2297,6 +2297,10 @@ class H5PContentValidator {
* FALSE if one or more files fail validation. Error message should be set accordingly by validator. * FALSE if one or more files fail validation. Error message should be set accordingly by validator.
*/ */
public function validateContentFiles($contentPath, $isLibrary = FALSE) { public function validateContentFiles($contentPath, $isLibrary = FALSE) {
if ($this->h5pC->disableFileCheck === TRUE) {
return TRUE;
}
// Scan content directory for files, recurse into sub directories. // Scan content directory for files, recurse into sub directories.
$files = array_diff(scandir($contentPath), array('.','..')); $files = array_diff(scandir($contentPath), array('.','..'));
$valid = TRUE; $valid = TRUE;