fix php5 compatibility
authorAlexandros Couloumbis <alex@ozo.com>
Mon, 9 Dec 2019 09:28:59 +0000 (11:28 +0200)
committerAlexandros Couloumbis <alex@ozo.com>
Mon, 9 Dec 2019 09:28:59 +0000 (11:28 +0200)
class/data/preg_wrapper.php

index 3d9fbd9b50c0332c898ec96587b66bd44b67289f..ae986e4c3737acd0af8181e4a1cd95a3f1d4a085 100644 (file)
@@ -35,7 +35,9 @@ function my_compile_regex($replacement)
 function my_preg_replace_internal($pattern, $replacement, $subject)
 {
     global $lwb_compiled_regexes;
-    $func = $lwb_compiled_regexes[$replacement] ?? my_compile_regex($replacement);
+    // make this php5 compatible
+    // $func = $lwb_compiled_regexes[$replacement] ?? my_compile_regex($replacement);
+    $func = isset($lwb_compiled_regexes[$replacement]) ? $lwb_compiled_regexes[$replacement] : my_compile_regex($replacement);
     return preg_replace_callback($pattern, $func, $subject);
 }