diff --git a/lib/filestorage/file_storage.php b/lib/filestorage/file_storage.php index 98af7b9bffc..56f049d88ed 100644 --- a/lib/filestorage/file_storage.php +++ b/lib/filestorage/file_storage.php @@ -493,8 +493,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); }