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

no following symlink #650

Open
MarcoHaase opened this issue Jul 24, 2023 · 0 comments
Open

no following symlink #650

MarcoHaase opened this issue Jul 24, 2023 · 0 comments

Comments

@MarcoHaase
Copy link

MarcoHaase commented Jul 24, 2023

Hey,

I am wondering, if you like this code in Compiler.php::tryImportPath for --no-follow option to import symlinked folders like "/var/www/public/extension_a/assets/scss/../../../extension_b/assets/scss"

in public folder:
.
..
extension_a -> ../private/packages/extension_a/
extension_b

if you try to import from symlinked folder, it always endup in file not found error message, because it will switch to private nonsymlinked folder.

      $parts = explode('/', $path);
        $resolvedPath = [];
        foreach ($parts as $part) {
            if ($part === '..') {
                array_pop($resolvedPath);
            } else {
                $resolvedPath[] = $part;
            }
        }
        $path = implode('/', $resolvedPath);

        $parts = explode('/', $partial);
        $resolvedPath = [];
        foreach ($parts as $part) {
            if ($part === '..') {
                array_pop($resolvedPath);
            } else {
                $resolvedPath[] = $part;
            }
        }
        $partial = implode('/', $resolvedPath);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant