[TASK] Make regexp in stdWrap_doubleBrTag readable 18/49718/2
authorJigal van Hemert <jigal.van.hemert@typo3.org>
Thu, 1 Sep 2016 12:52:44 +0000 (14:52 +0200)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Thu, 1 Sep 2016 21:48:20 +0000 (23:48 +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/49718
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Sascha Egerer <sascha@sascha-egerer.de>
Tested-by: Sascha Egerer <sascha@sascha-egerer.de>
Reviewed-by: Richard Haeser <richardhaeser@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php

index 5873777..b7acfde 100644 (file)
@@ -2923,11 +2923,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);
     }
 
     /**