Whitelisted originalImage and ratio when validating Image.

HFJ-1645
pull/17/head
Thomas Marstrander 2016-03-06 13:27:10 +01:00
parent fa7b42120d
commit ee245f9344
1 changed files with 2 additions and 2 deletions

View File

@ -2906,7 +2906,7 @@ class H5PContentValidator {
// Remove attributes that should not exist, they may contain JSON escape // Remove attributes that should not exist, they may contain JSON escape
// code. // code.
$validkeys = array_merge(array('path', 'mime', 'copyright', 'originalImage'), $typevalidkeys); $validkeys = array_merge(array('path', 'mime', 'copyright'), $typevalidkeys);
if (isset($semantics->extraAttributes)) { if (isset($semantics->extraAttributes)) {
$validkeys = array_merge($validkeys, $semantics->extraAttributes); // TODO: Validate extraAttributes $validkeys = array_merge($validkeys, $semantics->extraAttributes); // TODO: Validate extraAttributes
} }
@ -2951,7 +2951,7 @@ class H5PContentValidator {
* Validate given image data * Validate given image data
*/ */
public function validateImage(&$image, $semantics) { public function validateImage(&$image, $semantics) {
$this->_validateFilelike($image, $semantics, array('width', 'height')); $this->_validateFilelike($image, $semantics, array('ratio', 'width', 'height', 'originalImage'));
} }
/** /**