Skip to content

Commit

Permalink
Requested changed to keep_flashdata
Browse files Browse the repository at this point in the history
  • Loading branch information
johnathancroom committed Nov 24, 2012
1 parent 4beca5c commit 9d9849b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions system/libraries/Session/Session.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -389,18 +389,18 @@ public function set_flashdata($newdata = array(), $newval = '')
/** /**
* Keeps existing flashdata available to next request. * Keeps existing flashdata available to next request.
* *
* @param mixed Item key * @param mixed Item key(s)
* @return void * @return void
*/ */
public function keep_flashdata($data) public function keep_flashdata($data)
{ {
// Wrap item as array if singular // Wrap item as array if singular
if (is_string($data)) if (!is_array($data))
{ {
$data = array($data); $data = array($data);
} }


foreach($data as $key) foreach ($data as $key)
{ {
// 'old' flashdata gets removed. Here we mark all flashdata as 'new' to preserve it from _flashdata_sweep() // 'old' flashdata gets removed. Here we mark all flashdata as 'new' to preserve it from _flashdata_sweep()
// Note the function will return NULL if the $key provided cannot be found // Note the function will return NULL if the $key provided cannot be found
Expand All @@ -410,7 +410,6 @@ public function keep_flashdata($data)
$new_flashdata_key = self::FLASHDATA_KEY.self::FLASHDATA_NEW.$key; $new_flashdata_key = self::FLASHDATA_KEY.self::FLASHDATA_NEW.$key;
$this->set_userdata($new_flashdata_key, $value); $this->set_userdata($new_flashdata_key, $value);
} }

} }


// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Expand Down

0 comments on commit 9d9849b

Please sign in to comment.