From 0f0e5be549e4bea3086f59614ad5eb3458f2e53f Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 20 Jun 2012 16:05:46 -0700 Subject: contact search oddities --- mod/contacts.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mod/contacts.php') diff --git a/mod/contacts.php b/mod/contacts.php index f84a988c8..1463af903 100644 --- a/mod/contacts.php +++ b/mod/contacts.php @@ -479,12 +479,13 @@ function contacts_content(&$a) { - + $searching = false; if($search) { $search_hdr = $search; - $search = dbesc($search.'*'); + $search = dbesc(protect_sprintf('%' . $search . '%'); + $searching = true; } - $sql_extra .= ((strlen($search)) ? " AND MATCH `name` AGAINST ('$search' IN BOOLEAN MODE) " : ""); + $sql_extra .= (($searching) ? " AND `name` REGEXP '$search' " : ""); if($nets) $sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets)); -- cgit v1.2.3