Merge branch 'fix-improved-attribute-filtering'

release^2
Frode Petterson 2021-04-22 11:31:08 +02:00
commit affaa83b51
1 changed files with 4 additions and 4 deletions

View File

@ -4915,11 +4915,11 @@ class H5PContentValidator {
if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) { if (preg_match('/^([-a-zA-Z]+)/', $attr, $match)) {
$attrName = strtolower($match[1]); $attrName = strtolower($match[1]);
$skip = ( $skip = (
$attrname == 'style' || $attrName == 'style' ||
substr($attrname, 0, 2) == 'on' || substr($attrName, 0, 2) == 'on' ||
substr($attrname, 0, 1) == '-' || substr($attrName, 0, 1) == '-' ||
// Ignore long attributes to avoid unnecessary processing overhead. // Ignore long attributes to avoid unnecessary processing overhead.
strlen($attrname) > 96 strlen($attrName) > 96
); );
$working = $mode = 1; $working = $mode = 1;
$attr = preg_replace('/^[-a-zA-Z]+/', '', $attr); $attr = preg_replace('/^[-a-zA-Z]+/', '', $attr);