mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-02-20 01:21:20 +01:00
Fix PHP8 warnings
This commit is contained in:
@@ -326,7 +326,7 @@ function array_first($array)
|
||||
function asciiwords($str, $css_id = false, $replace_with = '')
|
||||
{
|
||||
$allowed = 'a-z0-9\_\-' . (!$css_id ? '\.' : '');
|
||||
return preg_replace("/[^$allowed]+/i", $replace_with, $str);
|
||||
return preg_replace("/[^$allowed]+/i", $replace_with, (string) $str);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -340,7 +340,7 @@ function asciiwords($str, $css_id = false, $replace_with = '')
|
||||
function is_ascii($str, $control_chars = true)
|
||||
{
|
||||
$regexp = $control_chars ? '/[^\x00-\x7F]/' : '/[^\x20-\x7E]/';
|
||||
return preg_match($regexp, $str) ? false : true;
|
||||
return preg_match($regexp, (string) $str) ? false : true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -833,7 +833,7 @@ class rcube
|
||||
$lang = $rcube_language_aliases[$lang];
|
||||
}
|
||||
// try the first two chars
|
||||
else if (!isset($rcube_languages[$lang])) {
|
||||
else if ($lang && !isset($rcube_languages[$lang])) {
|
||||
$short = substr($lang, 0, 2);
|
||||
|
||||
// check if we have an alias for the short language code
|
||||
@@ -846,7 +846,7 @@ class rcube
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($rcube_languages[$lang]) || !is_dir(RCUBE_LOCALIZATION_DIR . $lang)) {
|
||||
if (!$lang || !isset($rcube_languages[$lang]) || !is_dir(RCUBE_LOCALIZATION_DIR . $lang)) {
|
||||
$lang = 'en_US';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user