diff options
author | Owen Winkler <a_github@midnightcircus.com> | 2013-08-09 16:05:01 -0700 |
---|---|---|
committer | Owen Winkler <a_github@midnightcircus.com> | 2013-08-09 16:05:01 -0700 |
commit | 4128561f2265938fb4de4ed34873c594919dca35 (patch) | |
tree | 1c8778926a2e36f7a3e86273795ad0b5118b9355 /tests/lib/l10n.php | |
parent | 4c0ec974b9a8b97625695edd136e1f805af0bf31 (diff) | |
parent | 0e3dea7111e66c3619c6fe989e79ff80fb18e2b3 (diff) | |
download | nextcloud-server-4128561f2265938fb4de4ed34873c594919dca35.tar.gz nextcloud-server-4128561f2265938fb4de4ed34873c594919dca35.zip |
Merge pull request #4360 from owncloud/format-date-numeric-strings
Do not pass numeric strings to strtotime() when formatting dates.
Diffstat (limited to 'tests/lib/l10n.php')
-rw-r--r-- | tests/lib/l10n.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/lib/l10n.php b/tests/lib/l10n.php index dfc5790c2e7..12eac818f84 100644 --- a/tests/lib/l10n.php +++ b/tests/lib/l10n.php @@ -52,4 +52,16 @@ class Test_L10n extends PHPUnit_Framework_TestCase { $this->assertEquals('5 oken', (string)$l->n('%n window', '%n windows', 5)); } + /** + * Issue #4360: Do not call strtotime() on numeric strings. + */ + public function testNumericStringToDateTime() { + $l = new OC_L10N('test'); + $this->assertSame('February 13, 2009 23:31', $l->l('datetime', '1234567890')); + } + + public function testNumericToDateTime() { + $l = new OC_L10N('test'); + $this->assertSame('February 13, 2009 23:31', $l->l('datetime', 1234567890)); + } } |