From 2e491315a3def9ea3bd345c5a03121da8125d6c2 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 24 Jan 2013 22:49:21 +0100 Subject: m/user/username_exists: fix bug on empty/false argument username_exists(false) returned true because the condition matches any existing user. Signed-off-by: Florian Pritz --- application/models/muser.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'application') diff --git a/application/models/muser.php b/application/models/muser.php index 657c0bfc9..ee086994d 100644 --- a/application/models/muser.php +++ b/application/models/muser.php @@ -127,6 +127,10 @@ class Muser extends CI_Model { function username_exists($username) { + if ($username === false) { + return false; + } + $query = $this->db->query(" SELECT id FROM users -- cgit v1.2.3-24-g4f1b