X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdatetime.php;h=779c7a5aadae7f9b46e33fa1525130bbf3abad9b;hb=45d6f6c0a3ab8a0048dfb4fd3b28db065ad3a485;hp=16b134e90b13d8525fdfd3535f3694bb451ade2e;hpb=7886de5c393591eaf4e05f2a496a4f40060cb262;p=friendica.git diff --git a/include/datetime.php b/include/datetime.php index 16b134e90b..779c7a5aad 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -4,6 +4,7 @@ * @brief Some functions for date and time related tasks. */ +use \Friendica\Core\Config; /** * @brief Two-level sort for timezones. @@ -271,8 +272,9 @@ function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicke $lang = substr(get_browser_language(), 0, 2); // Check if the detected language is supported by the picker - if (!in_array($lang, array("ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"))) - $lang = ((isset($a->config['system']['language'])) ? $a->config['system']['language'] : 'en'); + if (!in_array($lang, array("ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"))) { + $lang = Config::get('system', 'language', 'en'); + } $o = ''; $dateformat = ''; @@ -552,8 +554,8 @@ function update_contact_birthdays() { // In-network birthdays are handled within local_delivery $r = q("SELECT * FROM contact WHERE `bd` != '' AND `bd` != '0000-00-00' AND SUBSTRING(`bd`,1,4) != `bdyear` "); - if(count($r)) { - foreach($r as $rr) { + if (dbm::is_result($r)) { + foreach ($r as $rr) { logger('update_contact_birthday: ' . $rr['bd']);