Skip to content

Commit

Permalink
Remove query string before checking if file exists, for windows + ope…
Browse files Browse the repository at this point in the history
…n_basedir. fixes #4438
  • Loading branch information
mattab committed Dec 26, 2013
1 parent 3a4363c commit 1782c1e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/Theme.php
Expand Up @@ -130,7 +130,14 @@ private function rewriteAssetPathIfOverridesFound($src)
$newThemePath = "plugins/" . $this->themeName;
$overridingAsset = str_replace($defaultThemePath, $newThemePath, $pathAsset);

if(file_exists($overridingAsset)) {
// Strip trailing query string
$fileToCheck = $overridingAsset;
$queryStringPos = strpos($fileToCheck, '?');
if( $queryStringPos !== 0) {
$fileToCheck = substr($fileToCheck, 0, $queryStringPos);
}

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

0 comments on commit 1782c1e

Please sign in to comment.