Skip to content

Commit d9a793b

Browse files
committed
ensure add array entry to $appPaths when strpos() found
1 parent 0bdef6b commit d9a793b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

system/Autoloader/FileLocator.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,10 @@ public function search(string $path, string $ext = 'php', bool $prioritizeApp =
250250
}
251251
else
252252
{
253-
$appPaths[] = $fullPath;
253+
if (! in_array($fullPath, $appPaths, true) && strpos($fullPath, APPPATH) === 0)
254+
{
255+
$appPaths[] = $fullPath;
256+
}
254257
}
255258
}
256259
}
@@ -260,7 +263,7 @@ public function search(string $path, string $ext = 'php', bool $prioritizeApp =
260263

261264
if (! $prioritizeApp && ! empty($appPaths))
262265
{
263-
$foundPaths = array_merge($foundPaths, array_unique($appPaths));
266+
$foundPaths = array_merge($foundPaths, $appPaths);
264267
}
265268

266269
return $foundPaths;

0 commit comments

Comments
 (0)