[TASK] Use different placeholder than ### 86/58586/3
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Sat, 6 Oct 2018 16:34:08 +0000 (18:34 +0200)
committerBenni Mack <benni@typo3.org>
Sun, 28 Oct 2018 13:34:33 +0000 (14:34 +0100)
preg_quote since PHP 7.3.0 also quotes #.
Simply use a different placeholder.

Resolves: #86586
Releases: master, 8.7, 7.6
Change-Id: I8ed9bd39605341a09347e21dd38c9a1824a01ee5
Reviewed-on: https://review.typo3.org/58586
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Jan Stockfisch <typo3@jan-stockfisch.de>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
Reviewed-by: Tomas Norre Mikkelsen <tomasnorre@gmail.com>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Jürgen Heym <juergen.heym@hof-university.de>
Tested-by: Jürgen Heym <juergen.heym@hof-university.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Utility/StringUtility.php

index 6536bdb..39330b2 100644 (file)
@@ -140,10 +140,10 @@ class StringUtility
                 // Regular expression, only "//" is allowed as delimiter
                 $regex = $needle;
             } else {
-                $needle = str_replace(['*', '?'], ['###MANY###', '###ONE###'], $needle);
+                $needle = str_replace(['*', '?'], ['%%%MANY%%%', '%%%ONE%%%'], $needle);
                 $regex = '/^' . preg_quote($needle, '/') . '$/';
                 // Replace the marker with .* to match anything (wildcard)
-                $regex = str_replace(['###MANY###', '###ONE###'], ['.*', '.'], $regex);
+                $regex = str_replace(['%%%MANY%%%', '%%%ONE%%%'], ['.*', '.'], $regex);
             }
             $result = (bool)preg_match($regex, $haystack);
         }