BUGFIX: Regexp from semantics does not contain delimiters. Add in PHP

namespaces
Frank Ronny Larsen 2013-07-10 11:02:17 +02:00
parent ec5c3ae1d5
commit b487f452d6
1 changed files with 1 additions and 1 deletions

View File

@ -1230,7 +1230,7 @@ class H5PContentValidator {
} }
// Check if string is according to optional regexp in semantics // Check if string is according to optional regexp in semantics
if (isset($semantics->regexp)) { if (isset($semantics->regexp)) {
$pattern = $semantics->regexp->pattern; $pattern = '|' . $semantics->regexp->pattern . '|';
$pattern .= isset($semantics->regexp->modifiers) ? $semantics->regexp->modifiers : ''; $pattern .= isset($semantics->regexp->modifiers) ? $semantics->regexp->modifiers : '';
if (preg_match($pattern, $text) === 0) { if (preg_match($pattern, $text) === 0) {
// Note: explicitly ignore return value FALSE, to avoid removing text // Note: explicitly ignore return value FALSE, to avoid removing text