diff --git a/core/lib/Drupal/Core/Config/FileStorage.php b/core/lib/Drupal/Core/Config/FileStorage.php index 52c9aa520db47c280911b3c85b9273d9efee3f76..bf178c56194cd77a31d9f9e1a02df8e8fe616d70 100644 --- a/core/lib/Drupal/Core/Config/FileStorage.php +++ b/core/lib/Drupal/Core/Config/FileStorage.php @@ -204,14 +204,11 @@ public function listAll($prefix = '') { throw new StorageException($this->directory . '/ not found.'); } $extension = '.' . static::getFileExtension(); - $files = new \GlobIterator(DRUPAL_ROOT . '/' . $this->directory . '/' . $prefix . '*' . $extension); - - $names = array(); - foreach ($files as $file) { - $names[] = $file->getBasename($extension); - } - - return $names; + $files = glob($this->directory . '/' . $prefix . '*' . $extension); + $clean_name = function ($value) use ($extension) { + return basename($value, $extension); + }; + return array_map($clean_name, $files); } /** diff --git a/core/lib/Drupal/Core/Config/InstallStorage.php b/core/lib/Drupal/Core/Config/InstallStorage.php index 16bcc1c3523f36d160eba8f4e1b2c5d4cb1137b1..e8442ea7a772135f8d51a7038ea47a3eab0c3c4d 100644 --- a/core/lib/Drupal/Core/Config/InstallStorage.php +++ b/core/lib/Drupal/Core/Config/InstallStorage.php @@ -134,9 +134,10 @@ public function getComponentNames($type, array $list) { foreach ($list as $name) { $directory = $this->getComponentFolder($type, $name); if (file_exists($directory)) { - $files = new \GlobIterator(DRUPAL_ROOT . '/' . $directory . '/*' . $extension); - foreach ($files as $file) { - $folders[$file->getBasename($extension)] = $directory; + $files = glob($directory . '/*' . $extension); + foreach ($files as $filename) { + $name = basename($filename, $extension); + $folders[$name] = $directory; } } } diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php index 3eefd376b7c1108a038babcdcf182ab2d96ccc6f..bc0dc61ac5b0257747c8d0793da35a1f7a50f3f5 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php @@ -320,9 +320,9 @@ public function getLangcodes() { if (empty($langcodes)) { $langcodes = array(); // Collect languages included with CKEditor based on file listing. - $ckeditor_languages = new \GlobIterator(DRUPAL_ROOT . '/core/assets/vendor/ckeditor/lang/*.js'); - foreach ($ckeditor_languages as $language_file) { - $langcode = $language_file->getBasename('.js'); + $ckeditor_languages = glob(DRUPAL_ROOT . '/core/assets/vendor/ckeditor/lang/*.js'); + foreach ($ckeditor_languages as $language_filename) { + $langcode = basename($language_filename, '.js'); $langcodes[$langcode] = $langcode; } cache('ckeditor.languages')->set('langcodes', $langcodes);