Issues

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

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?

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

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.

Fixed by Adam with ZF-11783.