aboutsummaryrefslogtreecommitdiffstats
path: root/mod/contacts.php
diff options
context:
space:
mode:
authorZvi ben Yaakov (a.k.a rdc) <coderzvi@infosoc.net>2012-06-21 13:38:14 +0300
committerZvi ben Yaakov (a.k.a rdc) <coderzvi@infosoc.net>2012-06-21 13:38:14 +0300
commit5e3e3915e347e4c298498ce0a8c493b9cd03201b (patch)
tree5a7aabb78964ab82caebac84299015af4f87882d /mod/contacts.php
parentd20cdf09eafbc57c1b6dbcb78a5cdaa731ae876d (diff)
parent53c9ea760659b39deeab9cff5d4f26d5abd63d31 (diff)
downloadvolse-hubzilla-5e3e3915e347e4c298498ce0a8c493b9cd03201b.tar.gz
volse-hubzilla-5e3e3915e347e4c298498ce0a8c493b9cd03201b.tar.bz2
volse-hubzilla-5e3e3915e347e4c298498ce0a8c493b9cd03201b.zip
Merge git://github.com/friendica/friendica
Diffstat (limited to 'mod/contacts.php')
-rw-r--r--mod/contacts.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index f84a988c8..fb4595739 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_txt = dbesc(protect_sprintf(preg_quote($search)));
+ $searching = true;
}
- $sql_extra .= ((strlen($search)) ? " AND MATCH `name` AGAINST ('$search' IN BOOLEAN MODE) " : "");
+ $sql_extra .= (($searching) ? " AND `name` REGEXP '$search_txt' " : "");
if($nets)
$sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets));
@@ -501,7 +502,6 @@ function contacts_content(&$a) {
}
-
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 0 AND `pending` = 0 $sql_extra $sql_extra2 ORDER BY `name` ASC LIMIT %d , %d ",
intval($_SESSION['uid']),
intval($a->pager['start']),
@@ -568,7 +568,7 @@ function contacts_content(&$a) {
'$total' => $total,
'$search' => $search_hdr,
'$desc' => t('Search your contacts'),
- '$finding' => (strlen($search) ? t('Finding: ') . "'" . $search . "'" : ""),
+ '$finding' => (($searching) ? t('Finding: ') . "'" . $search . "'" : ""),
'$submit' => t('Find'),
'$cmd' => $a->cmd,
'$contacts' => $contacts,