Only reflash flashed items.
This commit is contained in:
parent
e8561ca905
commit
285a744fac
|
@ -155,7 +155,17 @@ public static function flash($key, $value)
|
|||
*/
|
||||
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 @@ public static function keep($keys)
|
|||
{
|
||||
foreach ((array) $keys as $key)
|
||||
{
|
||||
$key = str_replace(array(':old:', ':new:'), '', $key);
|
||||
|
||||
static::flash($key, static::get($key));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue