Skip to content
Permalink
Browse files

Update index.php to serve static files with query strings.

Trim off the query string before attempting to locate the file on the
filesystem. Thanks to Marko Marković for the initial patch.

Fixes #3910
  • Loading branch information...
markstory committed Jul 10, 2013
1 parent 542d594 commit 2918ae9c7ab86208be25d5652d94c14685c59faa
Showing with 4 additions and 2 deletions.
  1. +2 −1 app/webroot/index.php
  2. +2 −1 lib/Cake/Console/Templates/skel/webroot/index.php
@@ -79,7 +79,8 @@
// for built-in server
if (php_sapi_name() == 'cli-server') {
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['REQUEST_URI'])) {
$uri = str_replace($_SERVER['SCRIPT_FILENAME'], WWW_ROOT, '');
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $uri)) {
return false;
}
$_SERVER['PHP_SELF'] = '/' . basename(__FILE__);
@@ -79,7 +79,8 @@
// for built-in server
if (php_sapi_name() === 'cli-server') {
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['REQUEST_URI'])) {
$uri = str_replace($_SERVER['SCRIPT_FILENAME'], WWW_ROOT, '');
if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $uri)) {
return false;
}
$_SERVER['PHP_SELF'] = '/' . basename(__FILE__);

0 comments on commit 2918ae9

Please sign in to comment.
You can’t perform that action at this time.