From 39d973c2988174e0c895d203b5dd7a7d3de8f1f9 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 17 Apr 2017 13:21:29 +0200 Subject: Use === for some equality checks Signed-off-by: Florian Pritz --- application/controllers/user.php | 6 +++--- application/models/muser.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/application/controllers/user.php b/application/controllers/user.php index 71f83b527..d87b544c7 100644 --- a/application/controllers/user.php +++ b/application/controllers/user.php @@ -206,7 +206,7 @@ class User extends MY_Controller { $error[]= "Invalid email."; } - if (!$password || $password != $password_confirm) { + if (!$password || $password !== $password_confirm) { $error[]= "No password or passwords don't match."; } @@ -385,7 +385,7 @@ class User extends MY_Controller { $password = $this->input->post("password"); $password_confirm = $this->input->post("password_confirm"); - if (!$password || $password != $password_confirm) { + if (!$password || $password !== $password_confirm) { $error[]= "No password or passwords don't match."; } @@ -620,7 +620,7 @@ class User extends MY_Controller { $this->data["password"] = $password; if ($process !== false) { - if (!$password || $password != $password_confirm) { + if (!$password || $password !== $password_confirm) { $error[]= "No password or passwords don't match."; } else { $this->data["hash"] = $this->muser->hash_password($password); diff --git a/application/models/muser.php b/application/models/muser.php index 9866f0c86..1ee6c259a 100644 --- a/application/models/muser.php +++ b/application/models/muser.php @@ -55,7 +55,7 @@ class Muser extends CI_Model { function logged_in() { if ($this->has_session()) { - return $this->session->userdata('logged_in') == true; + return $this->session->userdata('logged_in') === true; } return false; @@ -303,7 +303,7 @@ class Muser extends CI_Model { ->where('action', $action) ->get()->row_array(); - if (!isset($query["key"]) || $key != $query["key"]) { + if (!isset($query["key"]) || $key !== $query["key"]) { throw new \exceptions\UserInputException("user/get_action/invalid-action", "Invalid action key. Has the key been used already?"); } -- cgit v1.2.3-24-g4f1b