Why are we using | instead of / around the regex? Change to / so that we may use | inside the regex
parent
cd5fd2d3d9
commit
1a6ef6f0fa
|
@ -1240,7 +1240,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
|
||||||
|
|
Loading…
Reference in New Issue