mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Locale/Search
* remove obsolete and broken logographic check. * this fixes searches with "too short" search tokens
This commit is contained in:
@@ -881,12 +881,6 @@ abstract class Util
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo: create Locale object and integrate
|
|
||||||
public static function isLogographic(int $localeId) : bool
|
|
||||||
{
|
|
||||||
return $localeId == LOCALE_CN || $localeId == LOCALE_TW || $localeId == LOCALE_KR;
|
|
||||||
}
|
|
||||||
|
|
||||||
// default back to enUS if localization unavailable
|
// default back to enUS if localization unavailable
|
||||||
public static function localizedString(array $data, string $field, bool $silent = false) : string
|
public static function localizedString(array $data, string $field, bool $silent = false) : string
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -138,14 +138,14 @@ class SearchPage extends GenericPage
|
|||||||
continue;
|
continue;
|
||||||
else if ($clean[0] == '-')
|
else if ($clean[0] == '-')
|
||||||
{
|
{
|
||||||
if (mb_strlen($clean) < 4 && !Util::isLogographic(Lang::getLocale()->value))
|
if (mb_strlen($clean) < 4 && !Lang::getLocale()->isLogographic())
|
||||||
$this->invalid[] = mb_substr($raw, 1);
|
$this->invalid[] = mb_substr($raw, 1);
|
||||||
else
|
else
|
||||||
$this->excluded[] = mb_substr(str_replace('_', '\\_', $clean), 1);
|
$this->excluded[] = mb_substr(str_replace('_', '\\_', $clean), 1);
|
||||||
}
|
}
|
||||||
else if ($clean !== '')
|
else if ($clean !== '')
|
||||||
{
|
{
|
||||||
if (mb_strlen($clean) < 3 && !Util::isLogographic(Lang::getLocale()->value))
|
if (mb_strlen($clean) < 3 && !Lang::getLocale()->isLogographic())
|
||||||
$this->invalid[] = $raw;
|
$this->invalid[] = $raw;
|
||||||
else
|
else
|
||||||
$this->included[] = str_replace('_', '\\_', $clean);
|
$this->included[] = str_replace('_', '\\_', $clean);
|
||||||
|
|||||||
Reference in New Issue
Block a user