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

PathStackResolver only checks first path #28

Open
jroedel opened this issue May 30, 2018 · 1 comment
Open

PathStackResolver only checks first path #28

jroedel opened this issue May 30, 2018 · 1 comment

Comments

@jroedel
Copy link

jroedel commented May 30, 2018

It seems that the PathStackResolver's resolve function returns if the first path doesn't contain the requested resource. This has been giving me problems all morning. I propose making the following change:

public function resolve($name)
{
    if ($this->isLfiProtectionOn() && preg_match('#\.\.[\\\/]#', $name)) {
        return null;
    }
    foreach ($this->getPaths() as $path) {
        $asset = $this->resolveFile($path . $name);
        if (!$asset) {
            //return null;
            continue;
        }
        $asset->mimetype = $this->getMimeResolver()->getMimeType($name);
        return $asset;
    }
    return null;
}

PS thanks a lot for all your work wshafer!

@wshafer
Copy link
Owner

wshafer commented Jul 18, 2018

@jroedel - wow! Sorry for the delay I didn't know this issue got reported.

Your change looks good to me. Would you mind putting in a PR for this?

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

2 participants