diff --git a/lib/filestorage/file_storage.php b/lib/filestorage/file_storage.php index 31fd1fbf93c..581ab4c5dbc 100644 --- a/lib/filestorage/file_storage.php +++ b/lib/filestorage/file_storage.php @@ -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); }