Permalink
Browse files

Added empty rather than just testing variable, added trim to search s…

…tring in get_users and get_users_listing
  • Loading branch information...
1 parent fb54906 commit d20aa8e36ab841126bdfc95884889122e74ad350 mjollnir_ committed Dec 22, 2004
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/datalib.php
View
@@ -1539,7 +1539,8 @@ function get_users($get=true, $search="", $confirmed=false, $exceptions="", $sor
$select = "username <> 'guest' AND deleted = 0";
- if ($search) {
+ if (!empty($search)){
+ $search = trim($search);
$select .= " AND ($fullname $LIKE '%$search%' OR email $LIKE '%$search%') ";
}
@@ -1603,7 +1604,8 @@ function get_users_listing($sort="lastaccess", $dir="ASC", $page=0, $recordsperp
$select = 'deleted <> 1';
- if ($search) {
+ if (!empty($search)) {
+ $search = trim($search);
$select .= " AND ($fullname $LIKE '%$search%' OR email $LIKE '%$search%') ";
}

0 comments on commit d20aa8e

Please sign in to comment.