Commit 47e418fe authored by alexpott's avatar alexpott
Browse files

Issue #2457251 by vijaycs85: Remove unnecessary call to...

Issue #2457251 by vijaycs85: Remove unnecessary call to drupal_get_user_timezone() in Drupal/Core/Datetime/DrupalDateTime::prepareTimezone() method
parent e73ce6ea
...@@ -62,9 +62,9 @@ public function __construct($time = 'now', $timezone = NULL, $settings = array() ...@@ -62,9 +62,9 @@ public function __construct($time = 'now', $timezone = NULL, $settings = array()
* knowledge of the preferred user timezone. * knowledge of the preferred user timezone.
*/ */
protected function prepareTimezone($timezone) { protected function prepareTimezone($timezone) {
$user_timezone = drupal_get_user_timezone(); if (empty($timezone)) {
if (empty($timezone) && !empty($user_timezone)) { // Fallback to user or system default timezone.
$timezone = $user_timezone; $timezone = drupal_get_user_timezone();
} }
return parent::prepareTimezone($timezone); return parent::prepareTimezone($timezone);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment