Skip to content
Permalink
Browse files

Refactored the fix

  • Loading branch information...
Mark van Driel Mark van Driel
Mark van Driel authored and Mark van Driel committed Aug 15, 2013
1 parent 1595287 commit 97aaa89b3f83f760431c56dab108482cbf4f1434
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Cake/Utility/CakeTime.php
@@ -316,6 +316,11 @@ public static function fromString($dateString, $timezone = null) {
return false;
}
$containsDummyDate = (is_string($dateString) && substr($dateString, 0, 10) === '0000-00-00');
if ($containsDummyDate) {
return false;
}
if (is_int($dateString) || is_numeric($dateString)) {
$date = intval($dateString);
} elseif (
@@ -328,12 +333,7 @@ public static function fromString($dateString, $timezone = null) {
} elseif ($dateString instanceof DateTime) {
$date = (int)$dateString->format('U');
} else {
// workaround for strtotime("0000-00-00 00:00:00") returning -62169955200 on a 64 bit system.
if (substr($dateString, 0, 10) === '0000-00-00') {
$date = false;
} else {
$date = strtotime($dateString);
}
$date = strtotime($dateString);
}
if ($date === -1 || empty($date)) {

0 comments on commit 97aaa89

Please sign in to comment.
You can’t perform that action at this time.