Commit 5296f338 authored by Dries's avatar Dries

- Patch #4635 by Ber: user search should translate wildcard character

parent d7ee1eba
......@@ -296,6 +296,10 @@ function user_perm() {
function user_search($keys) {
$find = array();
// Replace wildcards with mysql wildcards
$keys = str_replace("*", "%", $keys);
$result = db_query_range("SELECT * FROM {users} WHERE name LIKE '%%%s%%'", $keys, 0, 20);
while ($account = db_fetch_object($result)) {
$find[] = array("title" => $account->name, "link" => (strstr(request_uri(), "admin") ? url("admin/user/edit/$account->uid") : url("user/view/$account->uid")), 'user' => $account->name);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment