Changeset 656 for trunk/lib


Ignore:
Timestamp:
Jan 25, 2019 11:29:23 PM (5 years ago)
Author:
anonymous
Message:

minor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r654 r656  
    378378                // tz cookie has a timezone offset, like "-6" (assume UTC).
    379379                $tz = timezone_name_from_abbr('', $_COOKIE['tz'] * 3600, 0);
    380                 if ($tz) {
     380                if ($tz && preg_match('![A-Z]{3,}|\w+/\w+!', $tz)) {
    381381                    // Valid.
    382382                    $this->setParam(array('timezone' => $tz));
     
    395395                // Failed: unset the timezone parameter so it isn't used to set the database timezone.
    396396                $this->setParam(array('timezone' => null));
    397                 $this->logMsg(sprintf('Failed to use timezone: %s', $this->getParam('timezone')), LOG_NOTICE, __FILE__, __LINE__);
    398             }
     397                $this->logMsg(sprintf('Failed to set timezone: %s', $this->getParam('timezone')), LOG_NOTICE, __FILE__, __LINE__);
     398            }
     399        } else {
     400            $this->logMsg(sprintf('Using server timezone: %s', date_default_timezone_get()), LOG_DEBUG, __FILE__, __LINE__);
    399401        }
    400402
Note: See TracChangeset for help on using the changeset viewer.