diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-04-21 17:50:28 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-04-21 17:50:28 +0000 |
commit | 9796455aafebd30d5c047677a6ef01091aba34eb (patch) | |
tree | adf6f1527e46e079286ff312e4d98df8b5990533 /modules/user.module | |
parent | 725298779d69af11f1c2d36809f53bf431e41f72 (diff) | |
download | brdo-9796455aafebd30d5c047677a6ef01091aba34eb.tar.gz brdo-9796455aafebd30d5c047677a6ef01091aba34eb.tar.bz2 |
- Patch #4635 by Ber: user search should translate wildcard character
Diffstat (limited to 'modules/user.module')
-rw-r--r-- | modules/user.module | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/user.module b/modules/user.module index c26311e1e..b51080225 100644 --- a/modules/user.module +++ b/modules/user.module @@ -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); |