Skip to content

Commit b5730bd

Browse files
Merge branch '4.4' into 5.1
* 4.4: [PhpUnitBridge] CS fix [PhpUnitBridge] Fix PHP 5.5 compatibility Add missing param annotation abouts $fileLinkFormat [Form] Fixed StringUtil::trim() to trim ZERO WIDTH SPACE (U+200B) and SOFT HYPHEN (U+00AD) 23412 Stop treating multiline resources as globs
2 parents 82fbd72 + 2a059af commit b5730bd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Tests/Util/StringUtilTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ public function spaceProvider()
7272
['000D'],
7373
['0085'],
7474
// zero width space
75-
// ['200B'],
75+
['200B'],
76+
// soft hyphen
77+
['00AD'],
7678
];
7779
}
7880

Util/StringUtil.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private function __construct()
3131
*/
3232
public static function trim(string $string)
3333
{
34-
if (null !== $result = @preg_replace('/^[\pZ\p{Cc}]+|[\pZ\p{Cc}]+$/u', '', $string)) {
34+
if (null !== $result = @preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $string)) {
3535
return $result;
3636
}
3737

0 commit comments

Comments
 (0)