Skip to content

Commit

Permalink
strip the script name to ensure that we do not hit a redirect recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmith77 committed May 4, 2012
1 parent 18875c1 commit ddeebf2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Imagine/Cache/Resolver/WebPathResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public function resolve(Request $request, $path, $filter)
// if the file has already been cached, we're probably not rewriting
// correctly, hence make a 301 to proper location, so browser remembers
if (file_exists($targetPath)) {
$scriptName = $request->getScriptName();
if (strpos($browserPath, $scriptName) === 0) {
// strip script name
$browserPath = substr($browserPath, strlen($scriptName));
}

return new RedirectResponse($request->getBasePath().$browserPath);
}

Expand Down

0 comments on commit ddeebf2

Please sign in to comment.