Merged in changed from drupal git.
parent
ece7b5bcde
commit
4d319b3424
|
@ -90,10 +90,10 @@ interface H5PFrameworkInterface {
|
||||||
* FALSE otherwise
|
* FALSE otherwise
|
||||||
*/
|
*/
|
||||||
public function isPatchedLibrary($library);
|
public function isPatchedLibrary($library);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is H5P in development mode?
|
* Is H5P in development mode?
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
* TRUE if H5P development mode is active
|
* TRUE if H5P development mode is active
|
||||||
* FALSE otherwise
|
* FALSE otherwise
|
||||||
|
@ -784,12 +784,12 @@ class H5PValidator {
|
||||||
*/
|
*/
|
||||||
private function getJsonData($filePath, $return_as_string = FALSE) {
|
private function getJsonData($filePath, $return_as_string = FALSE) {
|
||||||
$json = file_get_contents($filePath);
|
$json = file_get_contents($filePath);
|
||||||
if (!$json) {
|
if ($json === FALSE) {
|
||||||
return FALSE;
|
return FALSE; // Cannot read from file.
|
||||||
}
|
}
|
||||||
$jsonData = json_decode($json, TRUE);
|
$jsonData = json_decode($json, TRUE);
|
||||||
if (!$jsonData) {
|
if ($jsonData === NULL) {
|
||||||
return FALSE;
|
return FALSE; // JSON cannot be decoded or the recursion limit has been reached.
|
||||||
}
|
}
|
||||||
return $return_as_string ? $json : $jsonData;
|
return $return_as_string ? $json : $jsonData;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue