aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-06-20 16:20:55 -0700
committerfriendica <info@friendica.com>2012-06-20 16:20:55 -0700
commitf4e434cd46efccde7d341d7ae9c2b11859fb41ce (patch)
tree285a9b8cbbe3c778e14b7ffacf0cc609ee23050e /mod
parent03c05d8a2875e84b3de3b5a1aed0ee608aac302f (diff)
downloadvolse-hubzilla-f4e434cd46efccde7d341d7ae9c2b11859fb41ce.tar.gz
volse-hubzilla-f4e434cd46efccde7d341d7ae9c2b11859fb41ce.tar.bz2
volse-hubzilla-f4e434cd46efccde7d341d7ae9c2b11859fb41ce.zip
sort out contact search oddities
Diffstat (limited to 'mod')
-rw-r--r--mod/contacts.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/mod/contacts.php b/mod/contacts.php
index 423fd40a2..fb4595739 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -482,10 +482,10 @@ function contacts_content(&$a) {
$searching = false;
if($search) {
$search_hdr = $search;
- $search = dbesc(protect_sprintf('%' . $search . '%'));
+ $search_txt = dbesc(protect_sprintf(preg_quote($search)));
$searching = true;
}
- $sql_extra .= (($searching) ? " AND `name` REGEXP '$search' " : "");
+ $sql_extra .= (($searching) ? " AND `name` REGEXP '$search_txt' " : "");
if($nets)
$sql_extra .= sprintf(" AND network = '%s' ", dbesc($nets));
@@ -502,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']),
@@ -569,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,