diff --git a/webui/model/search/message.php b/webui/model/search/message.php index 0cd5cd09..ed0bc58e 100644 --- a/webui/model/search/message.php +++ b/webui/model/search/message.php @@ -370,7 +370,7 @@ class ModelSearchMessage extends Model { } - private function highlight_search_terms($s = '', $terms = array()) { + private function highlight_search_terms($s = '', $terms = '') { $terms = preg_replace("/(\'|\")/", "", $terms); $terms = explode(" ", $terms); @@ -378,7 +378,7 @@ class ModelSearchMessage extends Model { if(count($terms) <= 0) { return $s; } while(list($k, $v) = each($terms)) { - if($v == '') { continue; } + if(strlen($v) < 3) { continue; } $s = preg_replace("/$v/i", "$v", $s); } diff --git a/webui/model/user/auth.php b/webui/model/user/auth.php index 7e8fe470..4f7b9611 100644 --- a/webui/model/user/auth.php +++ b/webui/model/user/auth.php @@ -69,7 +69,7 @@ class ModelUserAuth extends Model { $query = $ldap->query(LDAP_BASE_DN, "(&(objectClass=" . LDAP_ACCOUNT_OBJECTCLASS . ")(" . LDAP_MAIL_ATTR . "=$username))", array()); - if(isset($query->row['dn'])) { + if(isset($query->row['dn']) && $query->row['dn']) { $a = $query->row; $ldap_auth = new LDAP(LDAP_HOST, $a['dn'], $password);