mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Fixing issue where 'data' could not be accessed with array access, there were tests in Dispatchers tests that expected this.
This commit is contained in:
parent
d2ea077b81
commit
e4cf8a6937
2 changed files with 7 additions and 1 deletions
|
@ -92,7 +92,7 @@ class CakeRequest implements ArrayAccess {
|
||||||
'mobile' => array('env' => 'HTTP_USER_AGENT', 'options' => array(
|
'mobile' => array('env' => 'HTTP_USER_AGENT', 'options' => array(
|
||||||
'Android', 'AvantGo', 'BlackBerry', 'DoCoMo', 'iPod', 'iPhone',
|
'Android', 'AvantGo', 'BlackBerry', 'DoCoMo', 'iPod', 'iPhone',
|
||||||
'J2ME', 'MIDP', 'NetFront', 'Nokia', 'Opera Mini', 'PalmOS', 'PalmSource',
|
'J2ME', 'MIDP', 'NetFront', 'Nokia', 'Opera Mini', 'PalmOS', 'PalmSource',
|
||||||
'portalmmm', 'Plucker', 'ReqwirelessWeb', 'SonyEricsson', 'Symbian', 'UP\.Browser',
|
'portalmmm', 'Plucker', 'ReqwirelessWeb', 'SonyEricsson', 'Symbian', 'UP\\.Browser',
|
||||||
'webOS', 'Windows CE', 'Xiino'
|
'webOS', 'Windows CE', 'Xiino'
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
@ -522,6 +522,9 @@ class CakeRequest implements ArrayAccess {
|
||||||
if ($name == 'url') {
|
if ($name == 'url') {
|
||||||
return $this->query;
|
return $this->query;
|
||||||
}
|
}
|
||||||
|
if ($name == 'data') {
|
||||||
|
return $this->data;
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -560,6 +560,9 @@ class CakeRequestTestCase extends CakeTestCase {
|
||||||
|
|
||||||
$request = new CakeRequest('some/path?one=something&two=else');
|
$request = new CakeRequest('some/path?one=something&two=else');
|
||||||
$this->assertTrue(isset($request['url']['one']));
|
$this->assertTrue(isset($request['url']['one']));
|
||||||
|
|
||||||
|
$request->data = array('Post' => array('title' => 'something'));
|
||||||
|
$this->assertEqual($request['data']['Post']['title'], 'something');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue