Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
432d6244
Commit
432d6244
authored
Jan 10, 2007
by
Steven Wittens
Browse files
#108130
: Don't allow empty autocomplete searches
parent
f4c82fa9
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/user/user.module
View file @
432d6244
...
...
@@ -2442,9 +2442,11 @@ function _user_forms(&$edit, $account, $category, $hook = 'form') {
*/
function
user_autocomplete
(
$string
=
''
)
{
$matches
=
array
();
$result
=
db_query_range
(
"SELECT name FROM
{
users
}
WHERE LOWER(name) LIKE LOWER('%s%%')"
,
$string
,
0
,
10
);
while
(
$user
=
db_fetch_object
(
$result
))
{
$matches
[
$user
->
name
]
=
check_plain
(
$user
->
name
);
if
(
$string
)
{
$result
=
db_query_range
(
"SELECT name FROM
{
users
}
WHERE LOWER(name) LIKE LOWER('%s%%')"
,
$string
,
0
,
10
);
while
(
$user
=
db_fetch_object
(
$result
))
{
$matches
[
$user
->
name
]
=
check_plain
(
$user
->
name
);
}
}
print
drupal_to_js
(
$matches
);
exit
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment