aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-04 14:51:41 -0800
committerfriendica <info@friendica.com>2015-01-04 14:51:41 -0800
commit3983348b96c1b41154e413998760de98606a4b72 (patch)
tree819cbd80a54c7333cfd227c75f2df252fafba4c8
parent91cb76aa99d56a134717dfe427d3abd8e81061af (diff)
downloadvolse-hubzilla-3983348b96c1b41154e413998760de98606a4b72.tar.gz
volse-hubzilla-3983348b96c1b41154e413998760de98606a4b72.tar.bz2
volse-hubzilla-3983348b96c1b41154e413998760de98606a4b72.zip
the last checkin removed hostname from the address for autocomplete searches. This one allows it if explicitly added with a '@'. So 'mike' will find all mikes. 'mike@z' will find mike@zothub but not mike@popcorn.
-rw-r--r--mod/acl.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/mod/acl.php b/mod/acl.php
index c18b56d8b..e6733351b 100644
--- a/mod/acl.php
+++ b/mod/acl.php
@@ -30,7 +30,7 @@ function acl_init(&$a){
if ($search != "") {
$sql_extra = " AND `name` LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
- $sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . "%@%'" ) . ") ";
+ $sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc($search) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
// This horrible mess is needed because position also returns 0 if nothing is found. W/ould be MUCH easier if it instead returned a very large value
// Otherwise we could just order by LEAST(POSTION($search IN xchan_name),POSITION($search IN xchan_addr)).