ZF-12111: FlashMessenger doesn't check for exception throw by Zend_Session_Namespace

Issue Type: Bug Created: 2012-03-21T18:40:18.000+0000 Last Updated: 2012-03-21T21:00:08.000+0000 Status: Open Fix version(s): Reporter: Drew Phillips (dapphp) Assignee: Ralph Schindler (ralph) Tags: - Zend_Session

Related issues: - ZF-7288



In my bootstrap, I initialize FlashMessenger for use in the application. When moving the app to a new server which did not yet have a valid session.save_path set, the application fails to run and results in a blank screen even though display_errors is on and error_reporting is set to E_ALL. An exception is thrown but is masked by an error handler, and FlashMessenger doesn't wrap its call to Zend_Session_Namespace in a try...catch block which results in a fatal uncaught exception error; but the fatal error is not displayed.

When constructing a FlashMessenger object, it creates a new Zend_Session_Namespace which can throw an exception if the session fails to start, however the call to new Zend_Session_Namespace in FlashMessenger::__construct is not in a try catch block.

Zend_Session::start registers its own error handler to see if session_start fails so the error is masked. This error handler seemed to stay active and masked further PHP fatal errors from being output.

TO REPRODUCE: Create a new Zend_Application. Set the session.save_path in php.ini to an invalid directory Set display_errors to On and error_reporting to E_ALL in php.ini Add a method _initFlashMessenger to your Bootstrap.php file with the following code: $flashMessenger = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger'); Run your application in the browser

EXPECTED RESULT: An exception or application error saying the session failed to start

ACTUAL RESULT: A page with no output and no messages added to any error_log


No comments to display

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.