Skip to content

Commit

Permalink
Use in middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickomeara committed Mar 29, 2024
1 parent 47941b4 commit 8d1286a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Illuminate/Foundation/Http/Middleware/TrimStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Closure;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;

class TrimStrings extends TransformsRequest
{
Expand Down Expand Up @@ -65,7 +66,7 @@ protected function transform($key, $value)
return $value;
}

return preg_replace('~^[\s\x{FEFF}\x{200B}]+|[\s\x{FEFF}\x{200B}]+$~u', '', $value) ?? trim($value);
return Str::trim($value);
}

/**
Expand Down

0 comments on commit 8d1286a

Please sign in to comment.