Skip to content

Commit b8bff1b

Browse files
committed
more verbose check for check prioritizeApp
1 parent d9a793b commit b8bff1b

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

system/Autoloader/FileLocator.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,20 @@ public function search(string $path, string $ext = 'php', bool $prioritizeApp =
244244
if (isset($namespace['path']) && is_file($namespace['path'] . $path))
245245
{
246246
$fullPath = $namespace['path'] . $path;
247-
if ($prioritizeApp || strpos($fullPath, APPPATH) !== 0)
247+
if ($prioritizeApp)
248248
{
249249
$foundPaths[] = $fullPath;
250250
}
251251
else
252252
{
253-
if (! in_array($fullPath, $appPaths, true) && strpos($fullPath, APPPATH) === 0)
253+
if (strpos($fullPath, APPPATH) === 0)
254254
{
255255
$appPaths[] = $fullPath;
256256
}
257+
else
258+
{
259+
$foundPaths[] = $fullPath;
260+
}
257261
}
258262
}
259263
}
@@ -263,7 +267,7 @@ public function search(string $path, string $ext = 'php', bool $prioritizeApp =
263267

264268
if (! $prioritizeApp && ! empty($appPaths))
265269
{
266-
$foundPaths = array_merge($foundPaths, $appPaths);
270+
$foundPaths = array_merge($foundPaths, array_unique($appPaths));
267271
}
268272

269273
return $foundPaths;

0 commit comments

Comments
 (0)