Skip to content

Commit 334e16c

Browse files
michalsnkenjis
andauthored
Update system/Autoloader/FileLocator.php
Co-authored-by: kenjis <kenji.uui@gmail.com>
1 parent b5c926e commit 334e16c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

system/Autoloader/FileLocator.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,9 @@ public function locateFile(string $file, ?string $folder = null, string $ext = '
7171
$namespaces = $this->autoloader->getNamespace();
7272

7373
foreach (array_keys($namespaces) as $namespace) {
74-
if (substr($file, 0, strlen($namespace)) === $namespace) {
74+
if (substr($file, 0, strlen($namespace) + 1) === $namespace . '\\') {
7575
$fileWithoutNamespace = substr($file, strlen($namespace));
76-
// Check if this is really another sub-namespace,
77-
// or just a namespace with a very similar name.
78-
if ($fileWithoutNamespace[0] !== '\\') {
79-
continue;
80-
}
76+
8177
// There may be sub-namespaces of the same vendor,
8278
// so overwrite them with namespaces found later.
8379
$paths = $namespaces[$namespace];

0 commit comments

Comments
 (0)