Skip to content

Commit acef596

Browse files
replace extension_exists() by function_exists() for mbstring
1 parent c122f1c commit acef596

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Geocoder/Result/AbstractResult.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function offsetUnset($offset)
6060
*/
6161
protected function formatString($str)
6262
{
63-
if (extension_loaded('mbstring')) {
63+
if (function_exists('mb_convert_case')) {
6464
$str = mb_convert_case($str, MB_CASE_TITLE, 'UTF-8');
6565
} else {
6666
$str = $this->lowerize($str);
@@ -82,7 +82,7 @@ protected function formatString($str)
8282
*/
8383
protected function lowerize($str)
8484
{
85-
return extension_loaded('mbstring') ? mb_strtolower($str, 'UTF-8') : strtolower($str);
85+
return function_exists('mb_strtolower') ? mb_strtolower($str, 'UTF-8') : strtolower($str);
8686
}
8787

8888
/**
@@ -94,6 +94,6 @@ protected function lowerize($str)
9494
*/
9595
protected function upperize($str)
9696
{
97-
return extension_loaded('mbstring') ? mb_strtoupper($str, 'UTF-8') : strtoupper($str);
97+
return function_exists('mb_strtoupper') ? mb_strtoupper($str, 'UTF-8') : strtoupper($str);
9898
}
9999
}

tests/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
if (!extension_loaded('curl') || !function_exists('curl_init')) {
3+
if (!function_exists('curl_init')) {
44
die(<<<EOT
55
cURL has to be enabled!
66
EOT

0 commit comments

Comments
 (0)