From c28cde4e56304d6f9c85c504a6c23c147a63059c Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 27 Jul 2013 17:01:35 -0400 Subject: [PATCH] Update webroot files to fix an issue in ServerShell. The previous fixes done in 2918ae9c7ab86208be25d5652d94c14685c59faa caused other issues preventing actions from being dispatched properly. Fixes #3934 --- app/webroot/index.php | 3 +-- lib/Cake/Console/Templates/skel/webroot/index.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/webroot/index.php b/app/webroot/index.php index 988343293..9e87e31d8 100644 --- a/app/webroot/index.php +++ b/app/webroot/index.php @@ -79,8 +79,7 @@ if (!defined('WWW_ROOT')) { // for built-in server if (php_sapi_name() == 'cli-server') { - $uri = str_replace($_SERVER['SCRIPT_FILENAME'], WWW_ROOT, ''); - if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $uri)) { + if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) { return false; } $_SERVER['PHP_SELF'] = '/' . basename(__FILE__); diff --git a/lib/Cake/Console/Templates/skel/webroot/index.php b/lib/Cake/Console/Templates/skel/webroot/index.php index 58aad8a3b..be88b567d 100644 --- a/lib/Cake/Console/Templates/skel/webroot/index.php +++ b/lib/Cake/Console/Templates/skel/webroot/index.php @@ -79,8 +79,7 @@ if (!defined('WWW_ROOT')) { // for built-in server if (php_sapi_name() === 'cli-server') { - $uri = str_replace($_SERVER['SCRIPT_FILENAME'], WWW_ROOT, ''); - if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $uri)) { + if ($_SERVER['REQUEST_URI'] !== '/' && file_exists(WWW_ROOT . $_SERVER['PHP_SELF'])) { return false; } $_SERVER['PHP_SELF'] = '/' . basename(__FILE__);