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:
+4
-2
@@ -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%') ";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user