|
|
@@ -146,7 +146,14 @@ class CakeRequest implements ArrayAccess {
|
|
|
|
|
|
/**
|
|
|
* process the post data and set what is there into the object.
|
|
|
- * processed data is available at $this->data
|
|
|
+ * processed data is available at `$this->data`
|
|
|
+ *
|
|
|
+ * Will merge POST vars prefixed with `data`, and ones without
|
|
|
+ * into a single array. Variables prefixed with `data` will overwrite those without.
|
|
|
+ *
|
|
|
+ * If you have mixed POST values be careful not to make any top level keys numeric
|
|
|
+ * containing arrays. Set::merge() is used to merge data, and it has possibly
|
|
|
+ * unexpected behavior in this situation.
|
|
|
*
|
|
|
* @return void
|
|
|
*/
|
|
|
@@ -166,8 +173,14 @@ class CakeRequest implements ArrayAccess {
|
|
|
}
|
|
|
unset($this->data['_method']);
|
|
|
}
|
|
|
+ $data = $this->data;
|
|
|
if (isset($this->data['data'])) {
|
|
|
$data = $this->data['data'];
|
|
|
+ }
|
|
|
+ if (count($this->data) <= 1) {
|
|
|
+ $this->data = $data;
|
|
|
+ }
|
|
|
+ if (count($this->data) > 1) {
|
|
|
unset($this->data['data']);
|
|
|
$this->data = Set::merge($this->data, $data);
|
|
|
}
|