From f48fd5aa1651cdc801473e9d24c1736304533e63 Mon Sep 17 00:00:00 2001 From: Friendika Date: Mon, 24 Oct 2011 04:17:46 -0700 Subject: more tagging --- mod/network.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'mod/network.php') diff --git a/mod/network.php b/mod/network.php index 04c2a1782..491603f35 100644 --- a/mod/network.php +++ b/mod/network.php @@ -333,10 +333,14 @@ function network_content(&$a, $update = 0) { $sql_extra2 = (($nouveau) ? '' : " AND `item`.`parent` = `item`.`id` "); - if(x($_GET,'search')) - $sql_extra .= " AND `item`.`body` REGEXP '" . dbesc(escape_tags($_GET['search'])) . "' "; + if(x($_GET,'search')) { + $search = escape_tags($_GET['search']); + $sql_extra .= sprintf(" AND ( `item`.`body` REGEXP '%s' OR `item`.`tag` REGEXP '%s' ) ", + dbesc($search), + dbesc('\\]' . $search . '\\[') + ); + } - $r = q("SELECT COUNT(*) AS `total` FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0 -- cgit v1.2.3