Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 2918ae9c7ab86208be25d5652d94c14685c59faa 1 parent 542d594
@markstory markstory authored
View
3  app/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__);
View
3  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__);
Please sign in to comment.
Something went wrong with that request. Please try again.