diff --git a/system/Autoloader/FileLocator.php b/system/Autoloader/FileLocator.php index d2018fa746e1..05f65f62ce30 100644 --- a/system/Autoloader/FileLocator.php +++ b/system/Autoloader/FileLocator.php @@ -127,7 +127,7 @@ public function locateFile(string $file, string $folder = null, string $ext = 'p // IF we have a folder name, then the calling function // expects this file to be within that folder, like 'Views', // or 'libraries'. - if (! empty($folder) && strpos($filename, $folder . '/') !== 0) + if (! empty($folder) && strpos($path . $filename, '/' . $folder . '/') === false) { $filename = $folder . '/' . $filename; }