[BUGFIX] Fix "Select & upload files" button for FAL in flexform 16/55516/6
authorArmin Vieweg <armin@v.ieweg.de>
Thu, 1 Feb 2018 09:20:15 +0000 (10:20 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Thu, 1 Feb 2018 12:20:49 +0000 (13:20 +0100)
Fix regular expression in escapeCssSelector method, to convert
e.g. "." to "\.".

Resolves: #83747
Branches: master, 8.7
Change-Id: I0fe19fb3590e28cafce6e2fd0cbf9a63f4375954
Reviewed-on: https://review.typo3.org/55516
Reviewed-by: Armin Vieweg <armin@v.ieweg.de>
Tested-by: Armin Vieweg <armin@v.ieweg.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Utility/StringUtility.php
typo3/sysext/core/Tests/Unit/Utility/StringUtilityTest.php

index c9ff0c9..5678fc0 100644 (file)
@@ -105,6 +105,6 @@ class StringUtility
      */
     public static function escapeCssSelector(string $selector) : string
     {
-        return preg_replace('([#:.\\[\\],=@])', '\\$1', $selector);
+        return preg_replace('/([#:.\\[\\],=@])/', '\\\\$1', $selector);
     }
 }
index 52f14af..8fe5b96 100644 (file)
@@ -219,6 +219,7 @@ class StringUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTestCase
     }
 
     /**
+     * @test
      * @param string $selector
      * @param string $expectedValue
      * @dataProvider escapeCssSelectorDataProvider