Browse Source

Fixed issue with unintentional flashdata

Fixed bug where as adding an error or info to flash data would result
in all errors/infos being added to the flash data.  Two temporary
arrays were used to store current flash data and are used to update
the flash data correctly as errors/info are added to flash data.
develop
tswagger 10 years ago
parent
commit
5ff1af124c
  1. 25
      application/libraries/Aauth.php

25
application/libraries/Aauth.php

@ -53,6 +53,25 @@ class Aauth {
* @var array * @var array
*/ */
public $infos = array(); public $infos = array();
/**
* Local temporary storage for current flash errors
*
* Used to update current flash data list since flash data is only available on the next page refresh
* @access public
* var array
*/
public $flash_errors = array();
/**
* Local temporary storage for current flash infos
*
* Used to update current flash data list since flash data is only available on the next page refresh
* @access public
* var array
*/
public $flash_infos = array();
######################## ########################
# Base Functions # Base Functions
@ -1664,7 +1683,8 @@ class Aauth {
public function error($message = '', $flashdata = false){ public function error($message = '', $flashdata = false){
$this->errors[] = $message; $this->errors[] = $message;
if($flashdata) { if($flashdata) {
$this->CI->session->set_flashdata('errors', $this->errors); $this->flash_errors[] = $message;
$this->CI->session->set_flashdata('errors', $this->flash_errors);
} }
} }
@ -1739,7 +1759,8 @@ class Aauth {
$this->infos[] = $message; $this->infos[] = $message;
if($flashdata) { if($flashdata) {
$this->CI->session->set_flashdata('infos', $this->infos); $this->flash_infos[] = $message;
$this->CI->session->set_flashdata('infos', $this->flash_infos);
} }
} }

Loading…
Cancel
Save