[BUGFIX] Sorting files in filelist is case sentive 73/19173/2
authorNicole Cordes <typo3@cordes.co>
Fri, 22 Mar 2013 11:55:45 +0000 (12:55 +0100)
committerBenjamin Mack <benni@typo3.org>
Fri, 22 Mar 2013 15:50:45 +0000 (16:50 +0100)
The sorting for files in the filelist is case sensitive while the sorting
for folders is not. The sorting should be adjusted to be identical for
files and folders.

Change-Id: I2aee28f42beb1f9b4b1eb969ee5503fd9bea0e23
Fixes: #46541
Releases: 6.1, 6.0
Reviewed-on: https://review.typo3.org/19173
Reviewed-by: Michael Staatz
Tested-by: Michael Staatz
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
typo3/sysext/filelist/Classes/FileList.php

index c4e8b5d..28805ea 100644 (file)
@@ -304,10 +304,9 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
                                        }
                                        $filesToSort[$sortingKey . $i] = $fileObject;
                                }
+                               uksort($filesToSort, 'strnatcasecmp');
                                if (intval($this->sortRev) === 1) {
-                                       krsort($filesToSort);
-                               } else {
-                                       ksort($filesToSort);
+                                       $filesToSort = array_reverse($filesToSort);
                                }
                                $files = $filesToSort;
                        }