]> git.mxchange.org Git - friendica.git/commitdiff
survive bad/un-parseable input to datetime_convert
authorfriendica <info@friendica.com>
Tue, 12 Jun 2012 09:06:29 +0000 (02:06 -0700)
committerfriendica <info@friendica.com>
Tue, 12 Jun 2012 09:06:29 +0000 (02:06 -0700)
include/datetime.php

index 3b1491e4d839429d5fb95390df171be39bc5ad54..f6bf1041e17625fa2a1d37c9e673adbc4bce2659 100644 (file)
@@ -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