mirror of
https://github.com/standardebooks/web.git
synced 2025-07-18 20:36:38 -04:00
Remove flaky iconv and replace with PHP-intl
This commit is contained in:
parent
ba53958596
commit
b812485d8a
3 changed files with 15 additions and 9 deletions
|
@ -342,9 +342,8 @@ class Ebook{
|
|||
}
|
||||
|
||||
// Remove diacritics and non-alphanumeric characters
|
||||
$searchString = str_replace(['‘,', '’'], '', $searchString);
|
||||
$searchString = trim(preg_replace('|[^a-zA-Z0-9 ]|ius', ' ', iconv('UTF-8', 'ASCII//TRANSLIT', $searchString) ?: '') ?? '');
|
||||
$query = trim(preg_replace('|[^a-zA-Z0-9 ]|ius', ' ', iconv('UTF-8', 'ASCII//TRANSLIT', $query) ?: '') ?? '');
|
||||
$searchString = trim(preg_replace('|[^a-zA-Z0-9 ]|ius', ' ', Formatter::RemoveDiacritics($searchString)) ?? '');
|
||||
$query = trim(preg_replace('|[^a-zA-Z0-9 ]|ius', ' ', Formatter::RemoveDiacritics($query)) ?? '');
|
||||
|
||||
if($query == ''){
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue