]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not pass numeric strings to strtotime() when formatting dates.
authorAndreas Fischer <bantu@owncloud.com>
Thu, 8 Aug 2013 14:52:11 +0000 (16:52 +0200)
committerAndreas Fischer <bantu@owncloud.com>
Fri, 9 Aug 2013 20:32:38 +0000 (22:32 +0200)
strtotime() will return false and the date will be formatted as the 0-timestamp
(e.g. January 1, 1970 00:00) otherwise.

lib/l10n.php

index d2da302b6448d655702092a5edad9780ecc1b218..5cfe119a4ffee5499fe4517bbc1c7eb829533a41 100644 (file)
@@ -387,7 +387,7 @@ class OC_L10N {
                                if($data instanceof DateTime) {
                                        return $data->format($this->localizations[$type]);
                                }
-                               elseif(is_string($data)) {
+                               elseif(is_string($data) && !is_numeric($data)) {
                                        $data = strtotime($data);
                                }
                                $locales = array(self::findLanguage());