Some enhancements for flags (#1470)

* Some enhancements for flags

* Update main.php

* Upload

* Update functions.php

* Update functions.php

* Update main.php

* Update CHANGELOG.md
This commit is contained in:
Roman Kelesidis 2024-05-05 23:48:00 +07:00 committed by GitHub
commit b80fa8857d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 3 deletions

View file

@ -1193,9 +1193,15 @@ function render_flag(string $code): string
global $lang;
static $iconExtension = '.svg';
$flagIconPath = BB_ROOT . 'styles/images/flags/' . $code . $iconExtension;
if (isset($lang['COUNTRIES'][$code]) && is_file($flagIconPath)) {
return '<img src="' . $flagIconPath . '" class="poster-flag" alt="' . $code . '" title="' . $lang['COUNTRIES'][$code] . '">';
if (isset($lang['COUNTRIES'][$code])) {
if ($code === '0') {
return ''; // No selected
} else {
$flagIconPath = BB_ROOT . 'styles/images/flags/' . $code . $iconExtension;
if (is_file($flagIconPath)) {
return '<img src="' . $flagIconPath . '" class="poster-flag" alt="' . $code . '" title="' . $lang['COUNTRIES'][$code] . '">';
}
}
}
return $code;