This addresses an e-notice
Change-Id: I82d3314bc2e28cca64ec9f4ed4d64477c50b7303
*/
public function getTimeZoneString() {
global $user;
- if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
+ // Note that 0 is a valid timezone (GMT) so we use strlen not empty to check.
+ if (variable_get('configurable_timezones', 1) && $user->uid && isset($user->timezone) && strlen($user->timezone)) {
$timezone = $user->timezone;
}
else {
*/
public function getTimeZoneString() {
global $user;
- if (variable_get('configurable_timezones', 1) && $user->uid && strlen($user->timezone)) {
+ // Note that 0 is a valid timezone (GMT) so we use strlen not empty to check.
+ if (variable_get('configurable_timezones', 1) && $user->uid && isset($user->timezone) && strlen($user->timezone)) {
$timezone = $user->timezone;
}
else {