Skip to content

Commit

Permalink
Update Str.php
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell authored Mar 18, 2021
1 parent 61fb05d commit 7b0259f
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/Illuminate/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -568,16 +568,13 @@ public static function replaceLast($search, $replace, $subject)
*/
public static function remove($search, $subject, $caseSensitive = true)
{
$regexSafeSearches = array_map(
function ($search) {
return preg_quote($search);
},
is_array($search) ? $search : [$search]
);
$regexSafeSearches = array_map(function ($search) {
return preg_quote($search);
}, is_array($search) ? $search : [$search]);

$regex = "/" . implode("|", $regexSafeSearches) . "/";
$regex = "/".implode("|", $regexSafeSearches)."/";

if (!$caseSensitive) {
if (! $caseSensitive) {
$regex .= "i";
}

Expand Down

0 comments on commit 7b0259f

Please sign in to comment.