Merge branch 'MDL-54008_29-normalise' of git://github.com/dmonllao/moodle into MOODLE_29_STABLE

This commit is contained in:
Dan Poltawski
2016-05-03 09:09:08 +01:00
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ class core_date {
// Convert to known zone.
$tz = self::$badzones[$tz];
$fixed = true;
} else if (is_number($tz)) {
} else if (is_numeric($tz)) {
// Half hour numeric offsets were already tested, try rounding to integers here.
$roundedtz = (string)(int)$tz;
if (isset(self::$badzones[$roundedtz])) {
+4
View File
@@ -390,5 +390,9 @@ class core_date_legacy_testcase extends advanced_testcase {
$USER->timezone = 'Europe/Prague';
$this->assertSame('Europe/Prague', usertimezone('99'));
// Checking fallback with an unexisting timezone.
$USER->timezone = '-9.23';
$this->assertSame('UTC-9', usertimezone('99'));
}
}