CakeRequest::_processPost PHP Method

_processPost() protected method

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. Hash::merge() is used to merge data, and it has possibly unexpected behavior in this situation.
protected _processPost ( ) : void
return void
    protected function _processPost()
    {
        if ($_POST) {
            $this->data = $_POST;
        } elseif (($this->is('put') || $this->is('delete')) && strpos($this->contentType(), 'application/x-www-form-urlencoded') === 0) {
            $data = $this->_readInput();
            parse_str($data, $this->data);
        }
        if (ini_get('magic_quotes_gpc') === '1') {
            $this->data = stripslashes_deep($this->data);
        }
        $override = null;
        if (env('HTTP_X_HTTP_METHOD_OVERRIDE')) {
            $this->data['_method'] = env('HTTP_X_HTTP_METHOD_OVERRIDE');
            $override = $this->data['_method'];
        }
        $isArray = is_array($this->data);
        if ($isArray && isset($this->data['_method'])) {
            if (!empty($_SERVER)) {
                $_SERVER['REQUEST_METHOD'] = $this->data['_method'];
            } else {
                $_ENV['REQUEST_METHOD'] = $this->data['_method'];
            }
            $override = $this->data['_method'];
            unset($this->data['_method']);
        }
        if ($override && !in_array($override, array('POST', 'PUT', 'PATCH', 'DELETE'))) {
            $this->data = array();
        }
        if ($isArray && isset($this->data['data'])) {
            $data = $this->data['data'];
            if (count($this->data) <= 1) {
                $this->data = $data;
            } else {
                unset($this->data['data']);
                $this->data = Hash::merge($this->data, $data);
            }
        }
    }