@EPinci opened this issue on December 25th 2013

Looks like, in Windows PHP 5.5.7, if the filename passed to file_exists() contains a querystring the open_basedir restrictions bogusly triggered. Dunno if relevant, i have two paths in my open_basedir directive.

I fixed the Core\Theme.php file as follows:

        // replace all plugin assets to the theme, if the theme overrides this asset
        // when there are name conflicts (two plugins define the same asset name in same folder),
        // we shall rename so there is no more conflict.
        $defaultThemePath = "plugins/" . $pathPluginName;
        $newThemePath = "plugins/" . $this->themeName;
        $overridingAsset = str_replace($defaultThemePath, $newThemePath, $pathAsset);

    // Strip trailing querystring, if any
    $fileToCheck = $overridingAsset;
    $posQMInFileToCheck = strpos($fileToCheck, '?');
        if( $posQMInFileToCheck !== 0) {
            $fileToCheck = substr($fileToCheck, 0, $posQMInFileToCheck);
        }

        if(file_exists($fileToCheck)) {
            return str_replace($pathAsset, $overridingAsset, $source);
        }
        return $source;

Thank you.

@mattab commented on December 26th 2013

In 1782c1e1821d5c340357363be773c9ad3d094827: Remove query string before checking if file exists, for windows + open_basedir. fixes #4438

This issue was closed on December 26th 2013
Powered by GitHub Issue Mirror