Flash bug when redirect_to (again)
Reported by Fabrice Luraine | August 7th, 2009 @ 01:34 PM | in Release 0.4 - Fresh Mint And Ginger
Flash features does'nt applies when we use redirect_to because there is no HTTP Content-type header sended in this case.
For now, a simple solution would be to handle this case in the stop_and_exit() function like this:
/**
* Stop and exit limonade application
*
* @access private
* @param boolean exit or not
* @return void
*/
function stop_and_exit($exit = true)
{
call_if_exists('before_exit');
$flash_sweep = true;
$headers = headers_list();
foreach($headers as $header)
{
// If a Content-Type header exists, flash_sweep only if is text/html
// Else if there's no Content-Type header, flash_sweep by default
if(stripos($header, 'Content-Type:') === 0)
{
$flash_sweep = stripos($header, 'Content-Type: text/html') === 0;
break;
}
}
if($flash_sweep) flash_sweep();
if(defined('SID')) session_write_close();
ob_end_clean(); // when request_is_head()
if($exit) exit;
}
... i'm still looking for a strongest way to manages flash messages.
Comments and changes to this ticket
-
Fabrice Luraine August 12th, 2009 @ 11:50 AM
- State changed from new to resolved
(from [68b9688691db54b8ddba5fc93f0b7a88b0f07dcf]) Fix flash bug when redirect_to [#22 state:resolved] http://github.com/sofadesign/limonade/commit/68b9688691db54b8ddba5f...
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
Limonade is a PHP micro-framework.
People watching this ticket
Referenced by
- 22 Flash bug when redirect_to (again) (from [68b9688691db54b8ddba5fc93f0b7a88b0f07dcf]) Fix fla...