mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing URL parsing/dispatching for IIS installs without rewrite support
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4699 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
1f0d3d7145
commit
983c55005c
3 changed files with 23 additions and 14 deletions
|
@ -918,10 +918,18 @@
|
|||
} elseif(env('REQUEST_URI')) {
|
||||
$uri = env('REQUEST_URI');
|
||||
} else {
|
||||
if (env('argv')) {
|
||||
$uri = env('argv');
|
||||
|
||||
if ($uri = env('argv')) {
|
||||
if (defined('SERVER_IIS')) {
|
||||
if (key($_GET) && strpos(key($_GET), '?') !== false) {
|
||||
unset($_GET[key($_GET)]);
|
||||
}
|
||||
$uri = preg_split('/\?/', $uri[0], 2);
|
||||
if (isset($uri[1])) {
|
||||
foreach (preg_split('/&/', $uri[1]) as $var) {
|
||||
@list($key, $val) = explode('=', $var);
|
||||
$_GET[$key] = $val;
|
||||
}
|
||||
}
|
||||
$uri = BASE_URL . $uri[0];
|
||||
} else {
|
||||
$uri = env('PHP_SELF') . '/' . $uri[0];
|
||||
|
|
|
@ -66,16 +66,20 @@ if (!defined('PHP5')) {
|
|||
if (strpos($uri, 'index.php') !== false) {
|
||||
$uri = r('?', '', $uri);
|
||||
$elements = explode('/index.php', $uri);
|
||||
} elseif (preg_match('/^[\/\?\/|\/\?|\?\/]/', $uri)) {
|
||||
$elements = array(1 => preg_replace('/^[\/\?\/|\/\?|\?\/]/', '', $uri));
|
||||
} else {
|
||||
$elements = explode('/?', $uri);
|
||||
$elements = array();
|
||||
}
|
||||
|
||||
if (!empty($elements[1])) {
|
||||
$_GET['url'] = $elements[1];
|
||||
$url = $elements[1];
|
||||
} else {
|
||||
$_GET['url'] = '/';
|
||||
$url = '/';
|
||||
$url = $_GET['url'] = '/';
|
||||
}
|
||||
if (strpos($url, '/') === 0 && $url != '/') {
|
||||
$url = $_GET['url'] = substr($url, 1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -190,12 +190,11 @@ class Dispatcher extends Object {
|
|||
$missingAction = true;
|
||||
}
|
||||
|
||||
if (in_array(strtolower($params['action']), array('tostring', 'requestaction', 'log',
|
||||
'cakeerror', 'constructclasses', 'redirect',
|
||||
'set', 'setaction', 'validate', 'validateerrors',
|
||||
'render', 'referer', 'flash', 'flashout',
|
||||
'generatefieldnames', 'postconditions', 'cleanupfields',
|
||||
'beforefilter', 'beforerender', 'afterfilter'))) {
|
||||
if (in_array(strtolower($params['action']), array(
|
||||
'tostring', 'requestaction', 'log', 'cakeerror', 'constructclasses', 'redirect', 'set', 'setaction',
|
||||
'validate', 'validateerrors', 'render', 'referer', 'flash', 'flashout', 'generatefieldnames',
|
||||
'postconditions', 'cleanupfields', 'beforefilter', 'beforerender', 'afterfilter'
|
||||
))) {
|
||||
$missingAction = true;
|
||||
}
|
||||
|
||||
|
@ -443,9 +442,7 @@ class Dispatcher extends Object {
|
|||
|
||||
if (isset($_FILES['data'])) {
|
||||
foreach ($_FILES['data'] as $key => $data) {
|
||||
|
||||
foreach ($data as $model => $fields) {
|
||||
|
||||
foreach ($fields as $field => $value) {
|
||||
$params['data'][$model][$field][$key] = $value;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue