From 43748bc4b8ea36e0536e683e794112bfe3351978 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Fri, 15 Jul 2016 15:33:11 +0200 Subject: [PATCH] Add documentation regarding stylePatterns --- h5p.classes.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/h5p.classes.php b/h5p.classes.php index 1021375..20ac82a 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -2863,6 +2863,7 @@ class H5PContentValidator { // Determine allowed style tags $stylePatterns = array(); + // All styles must be start to end patterns (^...$) if (isset($semantics->font)) { if (isset($semantics->font->size) && $semantics->font->size) { $stylePatterns[] = '/^font-size: *[0-9.]+(em|px|%) *;?$/i'; @@ -3519,6 +3520,7 @@ class H5PContentValidator { // Allow certain styles foreach ($allowedStyles as $pattern) { if (preg_match($pattern, $match[1])) { + // All patterns are start to end patterns, and CKEditor adds one span per style $attrArr[] = 'style="' . $match[1] . '"'; break; }