Merged from MOODLE_14_STABLE: Added empty rather than just testing variable, added trim to search string in get_users and get_users_listing

This commit is contained in:
mjollnir_
2004-12-22 23:11:27 +00:00
parent 301045e472
commit 0044147e10
+4 -2
View File
@@ -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%') ";
}