From 2228cb11cc7828b8834317dc23c8f672872b7f64 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 6 Sep 2010 13:05:19 +0000 Subject: [PATCH] handling totally absent dates in _strtotime, return current timestamp is all failes --- felamimail/inc/class.bofelamimail.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/felamimail/inc/class.bofelamimail.inc.php b/felamimail/inc/class.bofelamimail.inc.php index f1473ebc64..b19ab6989d 100644 --- a/felamimail/inc/class.bofelamimail.inc.php +++ b/felamimail/inc/class.bofelamimail.inc.php @@ -2931,6 +2931,7 @@ } /** * Helper function to handle wrong or unrecognized timezones + * returns the date as it is parseable by strtotime, or current timestamp if everything failes */ static function _strtotime($date='') { @@ -2938,12 +2939,13 @@ { $dtarr = explode(' ',$date); $test = false; - while ($test===false) + while ($test===false && count($dtarr)>=1) { array_pop($dtarr); $test=strtotime(implode(' ',$dtarr)); if ($test) $date = implode(' ',$dtarr); } + if ($test===false) $date = strtotime('now'); } return $date; }