From 47d0f830d3b95340f75460b012f9beadcea19aa5 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 2 Sep 2015 15:44:38 +0200 Subject: [PATCH 1/2] Removed asd --- js/h5p-resizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/h5p-resizer.js b/js/h5p-resizer.js index a1cf418..ab35e19 100644 --- a/js/h5p-resizer.js +++ b/js/h5p-resizer.js @@ -74,7 +74,7 @@ }; /** - * Keyup event handler. Exits full screen on escape.asdasd a + * Keyup event handler. Exits full screen on escape. * * @param {Event} event */ From cb59b9b79feaf35a1ce2a131cb03aa50860c3fc2 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Wed, 9 Sep 2015 13:28:16 +0200 Subject: [PATCH 2/2] Allowing text-align on wysiwygs [HPN-115] --- h5p.classes.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/h5p.classes.php b/h5p.classes.php index 4b88008..3a754f0 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -2536,6 +2536,7 @@ class H5PContentValidator { public $h5pF; public $h5pC; private $typeMap, $libraries, $dependencies, $nextWeight; + private static $allowed_stylable_tags = array('span', 'p', 'div'); /** * Constructor for the H5PContentValidator @@ -2625,6 +2626,9 @@ class H5PContentValidator { } } + // Aligment is allowed for all wysiwyg texts + $stylePatterns[] = '/^text-align: *(center|left|right);?$/i'; + // Strip invalid HTML tags. $text = $this->filter_xss($text, $tags, $stylePatterns); } @@ -3159,7 +3163,8 @@ class H5PContentValidator { $xhtml_slash = $count ? ' /' : ''; // Clean up attributes. - $attr2 = implode(' ', $this->_filter_xss_attributes($attrlist, ($elem === 'span' ? $this->allowedStyles : FALSE))); + + $attr2 = implode(' ', $this->_filter_xss_attributes($attrlist, (in_array($elem, self::$allowed_stylable_tags) ? $this->allowedStyles : FALSE))); $attr2 = preg_replace('/[<>]/', '', $attr2); $attr2 = strlen($attr2) ? ' ' . $attr2 : '';