Skip to content

Commit

Permalink
Implement @dasundev's from #50832
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickomeara committed Mar 29, 2024
1 parent 0104022 commit 7acdbfe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 7acdbfe

Please sign in to comment.