[TASK] Make regexp in stdWrap_doubleBrTag readable 37/49737/2
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Thu, 1 Sep 2016 12:52:44 +0000 (14:52 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sun, 4 Sep 2016 15:40:29 +0000 (17:40 +0200)
A regexp with escape sequences instead of non-printing
characters is easier to read and works with all file
systems.

Releases: master, 7.6
Resolves: #77748
Change-Id: I6f1c7e05d00cd6e8d839a4cb80b39863e281b52d
Reviewed-on: https://review.typo3.org/49737
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 9365202..1d59842 100644 (file)
@@ -3315,11 +3315,7 @@ class ContentObjectRenderer
      */
     public function stdWrap_doubleBrTag($content = '', $conf = [])
     {
-        return preg_replace('/
-?
-[       ]*
-?
-/', $conf['doubleBrTag'], $content);
+        return preg_replace('/\R{1,2}[\t\x20]*\R{1,2}/', $conf['doubleBrTag'], $content);
     }
 
     /**