Skip to content
Browse files

Refactored the fix

  • Loading branch information...
1 parent 1595287 commit 97aaa89b3f83f760431c56dab108482cbf4f1434 Mark van Driel committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/Cake/Utility/CakeTime.php
View
12 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.
Something went wrong with that request. Please try again.