From 7acdbfea1373cfa0250b293f9656fa062df50895 Mon Sep 17 00:00:00 2001 From: Patrick O'Meara Date: Sat, 30 Mar 2024 09:47:55 +1100 Subject: [PATCH] Implement @dasundev's from #50832 --- src/Illuminate/Support/Str.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Illuminate/Support/Str.php b/src/Illuminate/Support/Str.php index c4d785038f41..679e86bbb3f6 100644 --- a/src/Illuminate/Support/Str.php +++ b/src/Illuminate/Support/Str.php @@ -1428,7 +1428,7 @@ public static function snake($value, $delimiter = '_') public static function trim($value, $charlist = null) { if ($charlist === null) { - return preg_replace('~^[\s\x{FEFF}\x{200B}]+|[\s\x{FEFF}\x{200B}]+$~u', '', $value) ?? trim($value); + return preg_replace('~^[\s\x{FEFF}\x{200B}\x{200E}]+|[\s\x{FEFF}\x{200B}\x{200E}]+$~u', '', $value) ?? trim($value); } return trim($value, $charlist); @@ -1444,7 +1444,7 @@ public static function trim($value, $charlist = null) public static function ltrim($value, $charlist = null) { if ($charlist === null) { - return preg_replace('~^[\s\x{FEFF}\x{200B}]+~u', '', $value) ?? ltrim($value); + return preg_replace('~^[\s\x{FEFF}\x{200B}\x{200E}]+~u', '', $value) ?? ltrim($value); } return ltrim($value, $charlist); @@ -1460,7 +1460,7 @@ public static function ltrim($value, $charlist = null) public static function rtrim($value, $charlist = null) { if ($charlist === null) { - return preg_replace('~[\s\x{FEFF}\x{200B}]+$~u', '', $value) ?? rtrim($value); + return preg_replace('~[\s\x{FEFF}\x{200B}\x{200E}]+$~u', '', $value) ?? rtrim($value); } return rtrim($value, $charlist);