Browse Source

Only reflash flashed items.

Taylor Otwell 13 years ago
parent
commit
285a744fac
1 changed files with 11 additions and 3 deletions
  1. 11 3
      laravel/session.php

+ 11 - 3
laravel/session.php

@@ -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));
 		}
 	}