Skip to content

Commit

Permalink
Fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
Fan2Shrek committed Jun 19, 2024
2 parents c7f51b1 + 476cfd6 commit 5943e9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Mbstring/Mbstring.php
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ private static function mb_internal_trim(string $regex, string $string, ?string

return $test;
} catch (\Exception $e) {
return preg_replace($regex, "", $string);
return preg_replace('/'.$regex.'/', "", $string);
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Php84/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ function array_any(array $array, callable $callback): bool { return p\Php84::arr
function array_all(array $array, callable $callback): bool { return p\Php84::array_all($array, $callback); }
}

if (!function_exists('mb_trim')) {
if (!function_exists('mb_trim') && extension_loaded('mbstring')) {
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_trim($string, $characters, $encoding); }
}

if (!function_exists('mb_ltrim')) {
if (!function_exists('mb_ltrim') && extension_loaded('mbstring')) {
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_ltrim($string, $characters, $encoding); }
}

if (!function_exists('mb_rtrim')) {
if (!function_exists('mb_rtrim') && extension_loaded('mbstring')) {
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_rtrim($string, $characters, $encoding); }
}

0 comments on commit 5943e9c

Please sign in to comment.