From 6818d69fc344c8c44b72c1701380a43fba1ba155 Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Tue, 25 Sep 2012 15:23:46 +0200 Subject: [PATCH] Fixed issue in CakeTime that it would apply userOffset twice when using the format() function --- lib/Cake/Utility/CakeTime.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/Cake/Utility/CakeTime.php b/lib/Cake/Utility/CakeTime.php index f5e343fc6..35c7241d0 100644 --- a/lib/Cake/Utility/CakeTime.php +++ b/lib/Cake/Utility/CakeTime.php @@ -941,15 +941,11 @@ class CakeTime { * @see CakeTime::i18nFormat() */ public static function format($date, $format = null, $default = false, $timezone = null) { - //Backwards compatible params order + //Backwards compatible params re-order test $time = self::fromString($format, $timezone); - $_time = is_numeric($time) ? false : self::fromString($date, $timezone); - if (is_numeric($_time) && $time === false) { - return self::i18nFormat($_time, $format, $default, $timezone); - } - if ($time === false && $default !== false) { - return $default; + if ($time === false) { + return self::i18nFormat($date, $format, $default, $timezone); } return date($date, $time); }