From: friendica Date: Tue, 12 Jun 2012 09:06:29 +0000 (-0700) Subject: survive bad/un-parseable input to datetime_convert X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b6ff71acaab74169aeef575cd20cb7cba0756c42;p=friendica.git survive bad/un-parseable input to datetime_convert --- diff --git a/include/datetime.php b/include/datetime.php index 3b1491e4d8..f6bf1041e1 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -87,7 +87,7 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d $from = 'UTC'; if($to === '') $to = 'UTC'; - if($s === '') + if($s === '' || (! is_string($s))) $s = 'now'; // Slight hackish adjustment so that 'zero' datetime actually returns what is intended