ZF-11995: Zend_Amf_Response_Http uses $_SERVER['HTTPS'] without using isset($_SERVER['HTTPS']) causing an Exception within __toString

Issue Type: Patch Created: 2012-01-13T10:28:39.000+0000 Last Updated: 2012-01-13T14:40:54.000+0000 Status: Resolved Fix version(s): Reporter: Tobias Gassmann (tobias74) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Amf

  • state:patch-ready-for-review

Related issues: Attachments:


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'];


    $ssl = isset($_SERVER['HTTPS']) ? $_SERVER['HTTPS'] : false;

preventing the Exception from being thrown.

Now everything works fine for me.

Have a nice day :-) Tobias


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:

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.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.