Why are we using | instead of / around the regex? Change to / so that we may use | inside the regex

namespaces
Svein-Tore Griff With 2013-11-08 18:24:42 +01:00
parent cd5fd2d3d9
commit 1a6ef6f0fa
1 changed files with 1 additions and 1 deletions

View File

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