[TASK] Fix usage of functions, which are deprecated in PHP 5.5 56/21556/4
authorMarkus Klein <klein.t3@mfc-linz.at>
Thu, 20 Jun 2013 23:55:37 +0000 (01:55 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 15 Jul 2013 08:05:07 +0000 (10:05 +0200)
Fixes a call to preg_replace with /e modifier,
which is deprecated in PHP 5.5 now.

Resolves: #49300
Releases: 6.2, 6.1
Change-Id: I6bd4b57d64801be912e0050772420a684b1aa237
Reviewed-on: https://review.typo3.org/21556
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/core/Classes/Utility/GeneralUtility.php

index a813870..59cb852 100644 (file)
@@ -4588,7 +4588,13 @@ Connection: close
                        // No processing
                        $messageSubstituted = $message;
                } else {
-                       $messageSubstituted = preg_replace('/(http|https):\\/\\/.+(?=[\\]\\.\\?]*([\\! \'"()<>]+|$))/eiU', 'self::makeRedirectUrl("\\0",' . $lengthLimit . ',"' . $index_script_url . '")', $message);
+                       $messageSubstituted = preg_replace_callback(
+                               '/(http|https):\\/\\/.+(?=[\\]\\.\\?]*([\\! \'"()<>]+|$))/iU',
+                               function (array $matches) use ($lengthLimit, $index_script_url) {
+                                       return GeneralUtility::makeRedirectUrl($matches[0], $lengthLimit, $index_script_url);
+                               },
+                               $message
+                       );
                }
                return $messageSubstituted;
        }