From 54f8563dcef0686fc4696a7b33fc77d38a8783a0 Mon Sep 17 00:00:00 2001 From: CEkdhl Date: Fri, 14 Aug 2015 22:36:49 +0200 Subject: [PATCH] Fix issue with messages --- application/libraries/Aauth.php | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/application/libraries/Aauth.php b/application/libraries/Aauth.php index c893deba..2f4484f9 100644 --- a/application/libraries/Aauth.php +++ b/application/libraries/Aauth.php @@ -111,8 +111,8 @@ public function __construct() { $this->aauth_db = $this->CI->load->database($this->config_vars['db_profile'], TRUE); // load error and info messages from flashdata (but don't store back in flashdata) - $this->errors = $this->CI->session->flashdata('errors'); - $this->infos = $this->CI->session->flashdata('infos'); + $this->errors = $this->CI->session->flashdata('errors') ?: array(); + $this->infos = $this->CI->session->flashdata('infos') ?: array(); } @@ -1860,15 +1860,7 @@ public function keep_errors($include_non_flash = FALSE) */ public function get_errors_array() { - - if (!count($this->errors)==0) - { - return $this->errors; - } - else - { - return array(); - } + return $this->errors; } /** @@ -1955,14 +1947,7 @@ public function keep_infos($include_non_flash = FALSE) */ public function get_infos_array() { - if (!count($this->infos)==0) - { - return $this->infos; - } - else - { - return array(); - } + return $this->infos; }