Commit 9796455a authored by Dries's avatar Dries

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

parent 72529877
......@@ -354,6 +354,10 @@ function user_file_download($file) {
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);
......
......@@ -354,6 +354,10 @@ function user_file_download($file) {
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