Only reflash flashed items.

This commit is contained in:
Taylor Otwell
2011-11-07 13:48:08 -06:00
parent e8561ca905
commit 285a744fac

View File

@@ -155,7 +155,17 @@ class Session {
*/
public static function reflash()
{
static::keep(array_keys(static::$session['data']));
$flash = array();
foreach (static::$session['data'] as $key => $value)
{
if (strpos($key, ':old:') === 0)
{
$flash[] = str_replace(':old:', '', $key);
}
}
static::keep($flash);
}
/**
@@ -168,8 +178,6 @@ class Session {
{
foreach ((array) $keys as $key)
{
$key = str_replace(array(':old:', ':new:'), '', $key);
static::flash($key, static::get($key));
}
}