diff options
author | Dries Buytaert <dries@buytaert.net> | 2011-02-19 16:59:43 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2011-02-19 16:59:43 +0000 |
commit | 9c44a600456dd50c845eb4d3fd8ba547d46b0960 (patch) | |
tree | f3de85592d91582ae90caaee003776ff7116b724 /includes | |
parent | e06aca78ece17aa3d1e301b3455de0d5f9ca79f7 (diff) | |
download | brdo-9c44a600456dd50c845eb4d3fd8ba547d46b0960.tar.gz brdo-9c44a600456dd50c845eb4d3fd8ba547d46b0960.tar.bz2 |
- Rollback of accidentical commit #1064882.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/bootstrap.inc | 25 | ||||
-rw-r--r-- | includes/session.inc | 4 |
2 files changed, 6 insertions, 23 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index a8ef38a5b..0739332a4 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1136,7 +1136,6 @@ function drupal_serve_page_from_cache(stdClass $cache) { $etag = '"' . $cache->created . '-' . intval($return_compressed) . '"'; header('Etag: ' . $etag); - drupal_set_configured_timezone(); // See if the client has provided the required HTTP headers. $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) : FALSE; $if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ? stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : FALSE; @@ -1944,26 +1943,9 @@ function drupal_get_user_timezone() { return $user->timezone; } else { - // Note that is no site-wide timezone is set, and date.timezone is not set - // in php.ini, then calling date functions will cause a system call and - // PHP will issue an E_STRICT or E_WARNING error depending on PHP version. - // @todo: consider always setting the date_default_timezone variable from - // the installer. - return variable_get('date_default_timezone'); - } -} - -/** - * Set the timezone for a request when configured. - */ -function drupal_set_configured_timezone() { - $configured_timezone = drupal_get_user_timezone(); - $system_timezone = ini_get('date.timezone'); - // There is no point setting the timezone if it is configured the same - // as date.timezone in php.ini. Also date_default_timezone_set() validates - // the timezone, which relies on a system call to get the timezone database. - if ($configured_timezone != $system_timezone) { - date_default_timezone_set($configured_timezone); + // Ignore PHP strict notice if time zone has not yet been set in the php.ini + // configuration. + return variable_get('date_default_timezone', @date_default_timezone_get()); } } @@ -2064,6 +2046,7 @@ function _drupal_bootstrap_page_cache() { // Restore the metadata cached with the page. $_GET['q'] = $cache->data['path']; drupal_set_title($cache->data['title'], PASS_THROUGH); + date_default_timezone_set(drupal_get_user_timezone()); // If the skipping of the bootstrap hooks is not enforced, call // hook_boot. if (variable_get('page_cache_invoke_hooks', TRUE)) { diff --git a/includes/session.inc b/includes/session.inc index 478079b4f..23af6bd64 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -259,7 +259,7 @@ function drupal_session_initialize() { // a user becomes authenticated. session_id(drupal_hash_base64(uniqid(mt_rand(), TRUE))); } - drupal_set_configured_timezone(); + date_default_timezone_set(drupal_get_user_timezone()); } /** @@ -387,7 +387,7 @@ function drupal_session_regenerate() { drupal_session_start(); $user = $account; } - drupal_set_configured_timezone(); + date_default_timezone_set(drupal_get_user_timezone()); } /** |