MDL-40086 file: Correct ordering of subdirectories
Thanks to Mohamed Alsharaf for the proposed solution.
This commit is contained in:
@@ -647,8 +647,10 @@ class file_storage {
|
||||
protected function sort_area_tree($tree) {
|
||||
foreach ($tree as $key => &$value) {
|
||||
if ($key == 'subdirs') {
|
||||
$value = $this->sort_area_tree($value);
|
||||
collatorlib::ksort($value, collatorlib::SORT_NATURAL);
|
||||
foreach ($value as $subdirname => &$subtree) {
|
||||
$subtree = $this->sort_area_tree($subtree);
|
||||
}
|
||||
} else if ($key == 'files') {
|
||||
collatorlib::ksort($value, collatorlib::SORT_NATURAL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user