mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Fix error when saved value is not a valid country code
This commit is contained in:
parent
c26e242fdf
commit
c1278f2615
1 changed files with 10 additions and 3 deletions
|
|
@ -260,9 +260,16 @@ class Value
|
|||
case 'kr_zip':
|
||||
return is_array($value) ? implode(' ', $value) : $value;
|
||||
case 'country':
|
||||
$country = i18n::listCountries()[$value];
|
||||
$lang_type = \Context::getLangType();
|
||||
return $lang_type === 'ko' ? $country->name_korean : $country->name_english;
|
||||
$country = i18n::listCountries()[$value] ?? '';
|
||||
if ($country)
|
||||
{
|
||||
$lang_type = \Context::getLangType();
|
||||
return $lang_type === 'ko' ? $country->name_korean : $country->name_english;
|
||||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
}
|
||||
case 'language':
|
||||
return Lang::getSupportedList()[$value]['name'] ?? '';
|
||||
case 'date':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue