Merge branch 'master' into editor-padding

editor-padding
Frode Petterson 2015-09-10 10:02:43 +02:00
commit 1cf1a38a1b
2 changed files with 7 additions and 2 deletions

View File

@ -2536,6 +2536,7 @@ class H5PContentValidator {
public $h5pF; public $h5pF;
public $h5pC; public $h5pC;
private $typeMap, $libraries, $dependencies, $nextWeight; private $typeMap, $libraries, $dependencies, $nextWeight;
private static $allowed_stylable_tags = array('span', 'p', 'div');
/** /**
* Constructor for the H5PContentValidator * 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. // Strip invalid HTML tags.
$text = $this->filter_xss($text, $tags, $stylePatterns); $text = $this->filter_xss($text, $tags, $stylePatterns);
} }
@ -3159,7 +3163,8 @@ class H5PContentValidator {
$xhtml_slash = $count ? ' /' : ''; $xhtml_slash = $count ? ' /' : '';
// Clean up attributes. // 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 = preg_replace('/[<>]/', '', $attr2);
$attr2 = strlen($attr2) ? ' ' . $attr2 : ''; $attr2 = strlen($attr2) ? ' ' . $attr2 : '';

View File

@ -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 * @param {Event} event
*/ */