From 0044147e10bacee2fceed5632390b6a6ec6e5793 Mon Sep 17 00:00:00 2001 From: mjollnir_ Date: Wed, 22 Dec 2004 23:11:27 +0000 Subject: [PATCH] Merged from MOODLE_14_STABLE: Added empty rather than just testing variable, added trim to search string in get_users and get_users_listing --- lib/datalib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/datalib.php b/lib/datalib.php index 73df269af4..dd81fb5d19 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1713,7 +1713,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%') "; } @@ -1787,7 +1788,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%') "; } -- 2.39.5