From: Kevin Day Date: Sat, 3 Feb 2018 01:51:57 +0000 (-0600) Subject: Bugfix: a few unhandled or improperly error cases X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=694fdbdcc38eb00e6f5ebedc18766c56561ec234;p=koopa Bugfix: a few unhandled or improperly error cases --- diff --git a/common/standard/classes/standard_index.php b/common/standard/classes/standard_index.php index fc92751..fc405a3 100644 --- a/common/standard/classes/standard_index.php +++ b/common/standard/classes/standard_index.php @@ -416,7 +416,8 @@ class c_standard_index extends c_base_return { // some errors the cookie should be deleted and others it should remain untouched. // also set the error on the session object. - $this->session->set_error($session_connection->get_error()); + $errror = $session_connection->get_error(); + $this->session->set_error($error); unset($session_connection); $this->session->set_session_id(NULL); @@ -434,7 +435,8 @@ class c_standard_index extends c_base_return { // some errors the cookie should be deleted and others it should remain untouched. // also set the error on the session object. - $this->session->set_error($session_loaded->get_error()); + $error = $session_loaded->get_error(); + $this->session->set_error($error); unset($session_loaded); $this->session->set_session_id(NULL); diff --git a/common/standard/classes/standard_path_user.php b/common/standard/classes/standard_path_user.php index 8beff41..23a140a 100644 --- a/common/standard/classes/standard_path_user.php +++ b/common/standard/classes/standard_path_user.php @@ -190,8 +190,19 @@ class c_standard_path_user extends c_standard_path { } if (is_null($this->path_user_id)) { - $this->path_user = $this->session->get_user_current(); - $this->path_user_id = $this->path_user->get_id()->get_value_exact(); + $path_user = $this->session->get_user_current(); + if ($path_user instanceof c_base_users_user) { + $this->path_user = $path_user; + $this->path_user_id = $this->path_user->get_id()->get_value_exact(); + } + else { + if ($path_user->has_error()) { + $executed->set_error($path_user->get_error()); + } + + $this->path_user = FALSE; + } + unset($path_user); // do not allow view access to reserved/special accounts. if ($this->path_user_id < static::ID_USER_MINIMUM) {