Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the autoloader for Windows platforms #20877

Merged
merged 1 commit into from Jun 26, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+4 −4
Diff settings

Always

Just for now

Fix the autoloader for Windows platforms

  • Loading branch information...
mbabker committed Jun 26, 2018
commit 4962d8d809e4c4b7673d64fe01f692754645c8fe
Copy path View file
@@ -546,7 +546,7 @@ public static function loadByPsr4($class)
$classFilePath = realpath($path . DIRECTORY_SEPARATOR . substr_replace($classPath, '', 0, strlen($nsPath) + 1));
// We do not allow files outside the namespace root to be loaded
if (strpos($classFilePath, $path) !== 0)
if (strpos($classFilePath, realpath($path)) !== 0)
{
continue;
}
@@ -614,7 +614,7 @@ public static function loadByPsr0($class)
$classFilePath = realpath($path . DIRECTORY_SEPARATOR . $classPath);
// We do not allow files outside the namespace root to be loaded
if (strpos($classFilePath, $path) !== 0)
if (strpos($classFilePath, realpath($path)) !== 0)
{
continue;
}
@@ -733,7 +733,7 @@ private static function _load($class, $lookup)
$path = realpath($base . '/' . implode('/', array_map('strtolower', $parts)) . '.php');
// Load the file if it exists and is in the lookup path.
if (strpos($path, $base) === 0 && file_exists($path))
if (strpos($path, realpath($base)) === 0 && file_exists($path))
{
$found = (bool) include_once $path;
@@ -754,7 +754,7 @@ private static function _load($class, $lookup)
$path = realpath($base . '/' . implode('/', array_map('strtolower', array($parts[0], $parts[0]))) . '.php');
// Load the file if it exists and is in the lookup path.
if (strpos($path, $base) === 0 && file_exists($path))
if (strpos($path, realpath($base)) === 0 && file_exists($path))
{
$found = (bool) include_once $path;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.