Adding static variable to allow changing which get param cake uses. Refs #1483

This commit is contained in:
mark_story 2011-02-17 22:15:16 -05:00
parent 5c4854b897
commit 0cb5394d0b

View file

@ -79,6 +79,13 @@ class CakeRequest implements ArrayAccess {
*/
public $here = null;
/**
* The key to look for inside $_GET
*
* @var string
*/
public static $urlKey = 'url';
/**
* The built in detectors used with `is()` can be modified with `addDetector()`.
*
@ -231,7 +238,7 @@ class CakeRequest implements ArrayAccess {
* @return string URL
*/
protected function _url() {
if (empty($_GET['url'])) {
if (empty($_GET[self::$urlKey])) {
$uri = $this->_uri();
$base = $this->base;
@ -256,7 +263,7 @@ class CakeRequest implements ArrayAccess {
}
}
} else {
$url = $_GET['url'];
$url = $_GET[self::$urlKey];
}
return $url;
}
@ -306,7 +313,6 @@ class CakeRequest implements ArrayAccess {
$this->webroot = $base . '/';
$docRoot = env('DOCUMENT_ROOT');
$script = realpath(env('SCRIPT_FILENAME'));
$docRootContainsWebroot = strpos($docRoot, $dir . '/' . $webroot);
if (!empty($base) || !$docRootContainsWebroot) {