mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding static variable to allow changing which get param cake uses. Refs #1483
This commit is contained in:
parent
5c4854b897
commit
0cb5394d0b
1 changed files with 9 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue