From: Andreas Fischer Date: Thu, 8 Aug 2013 14:52:11 +0000 (+0200) Subject: Do not pass numeric strings to strtotime() when formatting dates. X-Git-Tag: v6.0.0alpha2~333^2~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9c22046bffac523e1eff12d7eff7409c786de176;p=nextcloud-server.git Do not pass numeric strings to strtotime() when formatting dates. strtotime() will return false and the date will be formatted as the 0-timestamp (e.g. January 1, 1970 00:00) otherwise. --- diff --git a/lib/l10n.php b/lib/l10n.php index d2da302b644..5cfe119a4ff 100644 --- a/lib/l10n.php +++ b/lib/l10n.php @@ -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());