Skip to content

Commit

Permalink
Add setlocale to mb_search
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed May 19, 2020
1 parent 400b682 commit 2c032bc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions api/v1/Location.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function getCities(string $countryName, string $search = NULL)
*/
public function mb_search(string $haystack, string $needle)
{
setlocale(LC_ALL, 'en_US.UTF8');
$haystack = preg_replace('/[\'^`~\"]/', '', iconv('UTF-8', 'ASCII//TRANSLIT', $haystack));
$needle = preg_replace('/[\'^`~\"]/', '', iconv('UTF-8', 'ASCII//TRANSLIT', $needle));
return mb_stripos($haystack, $needle);
Expand Down

0 comments on commit 2c032bc

Please sign in to comment.