From ee245f9344bbe9827b123dbac6122d6de1c9156f Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Sun, 6 Mar 2016 13:27:10 +0100 Subject: [PATCH] Whitelisted originalImage and ratio when validating Image. HFJ-1645 --- h5p.classes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/h5p.classes.php b/h5p.classes.php index b58ed11..87a576d 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -2906,7 +2906,7 @@ class H5PContentValidator { // Remove attributes that should not exist, they may contain JSON escape // code. - $validkeys = array_merge(array('path', 'mime', 'copyright', 'originalImage'), $typevalidkeys); + $validkeys = array_merge(array('path', 'mime', 'copyright'), $typevalidkeys); if (isset($semantics->extraAttributes)) { $validkeys = array_merge($validkeys, $semantics->extraAttributes); // TODO: Validate extraAttributes } @@ -2951,7 +2951,7 @@ class H5PContentValidator { * Validate given image data */ public function validateImage(&$image, $semantics) { - $this->_validateFilelike($image, $semantics, array('width', 'height')); + $this->_validateFilelike($image, $semantics, array('ratio', 'width', 'height', 'originalImage')); } /**