mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding auto-detection check for IIS (manually defining SERVER_IIS is no longer required), and fixing setUri for rewritten IIS URLs.
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4858 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
ee403daf5d
commit
ef79f256a7
2 changed files with 8 additions and 2 deletions
|
@ -921,7 +921,7 @@
|
|||
$uri = env('REQUEST_URI');
|
||||
} else {
|
||||
if ($uri = env('argv')) {
|
||||
if (defined('SERVER_IIS')) {
|
||||
if (defined('SERVER_IIS') && SERVER_IIS) {
|
||||
if (key($_GET) && strpos(key($_GET), '?') !== false) {
|
||||
unset($_GET[key($_GET)]);
|
||||
}
|
||||
|
@ -940,7 +940,7 @@
|
|||
$uri = env('PHP_SELF') . '/' . env('QUERY_STRING');
|
||||
}
|
||||
}
|
||||
return $uri;
|
||||
return preg_replace('/\?url=\//', '', $uri);
|
||||
}
|
||||
/**
|
||||
* Gets an environment variable from available sources, and provides emulation
|
||||
|
|
|
@ -47,6 +47,12 @@ if (!defined('PHP5')) {
|
|||
Configure::store(null, 'class.paths');
|
||||
Configure::load('class.paths');
|
||||
Configure::write('debug', DEBUG);
|
||||
/**
|
||||
* Check for IIS Server
|
||||
*/
|
||||
if (!defined('SERVER_IIS') && php_sapi_name() == 'isapi') {
|
||||
define('SERVER_IIS', true);
|
||||
}
|
||||
/**
|
||||
* Get the application path and request URL
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue