Skip to content

Bug in head() function which prohibits proper access to request headers #555

@ghost

Description

While attempting to use the REST_Controller, I have came across problems in accessing the HTTP headers of the request. Looking into the problem I have found that in the function head(), references to the header arguments were wrongly via head_args[], but should have been correctly via _head_args[].

Provided below is the patched code:

public function head($key = NULL, $xss_clean = NULL)
{
    if ($key === NULL)
    {
        return $this->_head_args;
    }

    return isset($this->_head_args[$key]) ? $this->_xss_clean($this->_head_args[$key], $xss_clean) : NULL;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions