Project

General

Profile

Actions

Bug #73754

closed

LocalDriver sorting bug if multiple file with same timestamp

Added by Yohann CERDAN about 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
Start date:
2016-02-29
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
Stabilization Sprint

Description

Hi,

I found a bug in the typo3_src-7.6.4/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php.

I use the function retrieveFileAndFoldersInPath() to recursively list file in a Folder. This list is sort by timestamp.

In the function sortDirectoryEntries() we create an array with timestamp=>File.

At the end of this function we do this:


$i = 0;
while (isset($entriesToSort[$sortingKey . $i])) {
 $i++;
}
$entriesToSort[intval($sortingKey . $i)] = $entryArray;

I think the developper implement this to avoid duplicate key, in my case, duplicate timestamp.
So the while() add an extra value to the timestamp. But when you have more than 10 files with the same timestamp, you have a number bigger than before.

Here is a simple example:
  • I have a 9 files wit the timestamp 1355300542.
  • If i have another file with the same timestamp the key will be 135530054210.

To process a sorting on number with strnatcasecmp(), this is a big issue and the list return is not the good one.
This bug happen for sorting file by timesamp and size.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #56746: File list always fetches all files in folderClosed2014-03-11

Actions
Actions

Also available in: Atom PDF