Applying optimization in Dispatcher::parseParams() from 'robustsolution'. Fixes #309

This commit is contained in:
mark_story 2009-11-15 15:32:58 -05:00
parent 17e377de7e
commit 6039d6ebe4

View file

@ -271,7 +271,7 @@ class Dispatcher extends Object {
$params['form']['_method'] = env('HTTP_X_HTTP_METHOD_OVERRIDE');
}
if (isset($params['form']['_method'])) {
if (isset($_SERVER) && !empty($_SERVER)) {
if (!empty($_SERVER)) {
$_SERVER['REQUEST_METHOD'] = $params['form']['_method'];
} else {
$_ENV['REQUEST_METHOD'] = $params['form']['_method'];