check if class Locale exists before using it

This commit is contained in:
Klaus Leithoff 2016-05-06 11:07:42 +00:00
parent 5261404c53
commit cb6be27b12

View File

@ -96,7 +96,7 @@ class preferences_hooks
if (empty($lang)) $lang = 'en';
}
list(,$country) = explode('-',$lang);
if (empty($country)) $country = Locale::getRegion(Locale::getDefault());
if (empty($country) && class_exists('Locale')) $country = Locale::getRegion(Locale::getDefault());
if (empty($country)) $country = 'de';
// check for old rte_font_size pref including px and split it in size and unit