ZF-11995: Zend_Amf_Response_Http uses $_SERVER['HTTPS'] without using isset($_SERVER['HTTPS']) causing an Exception within __toString
Description
Zend_Amf_Response_Http throws an Exception within a __toString-Call. This results in a fatal error: "Method Zend_Amf_Response_Http::__toString() must not throw an exception".
On Line 59 in Zend_Amf_Response_Http (Http.php) I changed
$ssl = $_SERVER['HTTPS'];
to
$ssl = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : false;
preventing the Exception from being thrown.
Now everything works fine for me.
Have a nice day :-) Tobias
Comments
Posted by Wade Arnold (wadearnold) on 2012-01-13T13:33:17.000+0000
Tobias thanks for the patch! What is wrong with the web server that makes this not work? Just trying to figure out how to make throw the exception. Is it if the endpoint was configured for https but the server does not serve content over https?
Posted by Paul Brand (paulb) on 2012-01-13T13:51:36.000+0000
If you have error reporting level to show notices, it will show an error when not using HTTPS. See also here: http://framework.zend.com/issues/browse/ZF-11783
Posted by Matthew Weier O'Phinney (matthew) on 2012-01-13T14:40:31.000+0000
This is already fixed in trunk and on the release-1.11 branch, and will be released with 1.11.12; the current patch was applied for ZF-11783.
Posted by Matthew Weier O'Phinney (matthew) on 2012-01-13T14:40:54.000+0000
Fixed by Adam with ZF-11783.