diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-12-05 21:53:09 +0300 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-12-05 21:53:09 +0300 |
commit | 116a1b366a0396f5861fd50f5231d7079880594e (patch) | |
tree | 82b11f8eace61c1d3643701698736c945bbb0b7f /apps | |
parent | 941a983d09c24c98d3fab4c06d3dc5449749221b (diff) | |
parent | 0dcfd5f20b86b5c64cac13407a2d83862fcb0a15 (diff) |
Merge pull request #11485 from brumsoel/master
Fix timestamp comparator return value
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/lib/helper.php | 2 | ||||
-rw-r--r-- | apps/files/tests/helper.php | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index aa5a2f8c68a..97b9d8e7044 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -82,7 +82,7 @@ class Helper public static function compareTimestamp(FileInfo $a, FileInfo $b) { $aTime = $a->getMTime(); $bTime = $b->getMTime(); - return $aTime - $bTime; + return ($aTime < $bTime) ? -1 : 1; } /** diff --git a/apps/files/tests/helper.php b/apps/files/tests/helper.php index da902f4f78a..1b7c8eef43a 100644 --- a/apps/files/tests/helper.php +++ b/apps/files/tests/helper.php @@ -33,10 +33,10 @@ class Test_Files_Helper extends \Test\TestCase { */ private function getTestFileList() { return array( - self::makeFileInfo('a.txt', 4, 1000), + self::makeFileInfo('a.txt', 4, 2.3 * pow(10, 9)), self::makeFileInfo('q.txt', 5, 150), self::makeFileInfo('subdir2', 87, 128, true), - self::makeFileInfo('b.txt', 166, 800), + self::makeFileInfo('b.txt', 2.2 * pow(10, 9), 800), self::makeFileInfo('o.txt', 12, 100), self::makeFileInfo('subdir', 88, 125, true), ); |