diff --git a/system/Autoloader/Autoloader.php b/system/Autoloader/Autoloader.php index 359e5eb1af6a..598ae7b61923 100644 --- a/system/Autoloader/Autoloader.php +++ b/system/Autoloader/Autoloader.php @@ -422,7 +422,7 @@ protected function discoverComposerNamespaces() unset($paths['CodeIgniter\\']); } - // Composer stores paths with trailng slash. We don't. + // Composer stores namespaces with trailing slash. We don't. $newPaths = []; foreach ($paths as $key => $value) { diff --git a/system/Autoloader/FileLocator.php b/system/Autoloader/FileLocator.php index bdbb91f9335c..9de461a888f5 100644 --- a/system/Autoloader/FileLocator.php +++ b/system/Autoloader/FileLocator.php @@ -408,7 +408,7 @@ public function listNamespaceFiles(string $prefix, string $path): array // autoloader->getNamespace($prefix) returns an array of paths for that namespace foreach ($this->autoloader->getNamespace($prefix) as $namespacePath) { - $fullPath = realpath($namespacePath . $path); + $fullPath = realpath(rtrim($namespacePath, '/') . '/' . $path); if (! is_dir($fullPath)) {