mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-23 14:28:45 +01:00
handling totally absent dates in _strtotime, return current timestamp is all failes
This commit is contained in:
parent
126c121210
commit
8ef9570d93
@ -3037,6 +3037,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='')
|
||||
{
|
||||
@ -3044,12 +3045,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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user