ZF-12219: Improvement to Zend_Controller_Request_Http::isPost()
Description
Current function does this:
'POST' == $this->getMethod()
If setMethod('post') is used on an instance of Zend_Form then isPost() will never be true.
Updated function would look like this:
public function isPost()
{
if ('POST' == strtoupper($this->getMethod())) {
return true;
}
return false;
}
Comments
Posted by Frank Brückner (frosch) on 2012-05-21T15:48:34.000+0000
Hi James, sorry I can not follow: why you are using a {{Zend_Controller_Request_Http}} instance in your form?
How it helps in a {{Zend_Form}} object? (?)
Posted by Adam Lundrigan (adamlundrigan) on 2012-05-29T18:51:16.000+0000
I think the example may be bogus ($form->setMethod('post') has no bearing on the case-sensitivity of the actual HTTP request that results from submitting the form), but combined with this comment in the PHP manual it may be worth looking at whether we should still apply the fix?
Posted by Rob Allen (rob) on 2012-05-31T18:39:02.000+0000
The correct HTTP method is POST in all caps which is what is tested for.