aboutsummaryrefslogtreecommitdiffstats
path: root/mod/search.php
diff options
context:
space:
mode:
authorThomas Willingham <founder@kakste.com>2012-04-02 00:29:27 +0100
committerThomas Willingham <founder@kakste.com>2012-04-02 00:29:27 +0100
commit210586eaed18afc4d9ff613ee8f1ea0acdec621a (patch)
tree49c8e91f210815eeccd6925457664f39380f0a82 /mod/search.php
parent8406803473773404b18b95c709da0b8f5da59d3c (diff)
parent23dc376364b7d8f8e27e3493fe3edbf5cf768a35 (diff)
downloadvolse-hubzilla-210586eaed18afc4d9ff613ee8f1ea0acdec621a.tar.gz
volse-hubzilla-210586eaed18afc4d9ff613ee8f1ea0acdec621a.tar.bz2
volse-hubzilla-210586eaed18afc4d9ff613ee8f1ea0acdec621a.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/search.php')
-rwxr-xr-xmod/search.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/mod/search.php b/mod/search.php
index 50e7a6abc..6495fc8e5 100755
--- a/mod/search.php
+++ b/mod/search.php
@@ -97,19 +97,16 @@ function search_content(&$a) {
// OR your own posts if you are a logged in member
// No items will be shown if the member has a blocked profile wall.
- $s_regx = sprintf("AND ( `item`.`body` REGEXP '%s' OR `item`.`tag` REGEXP '%s' )",
- dbesc(preg_quote($search)), dbesc('\\]' . preg_quote($search) . '\\['));
-
- $search_alg = $s_regx;
-
$r = q("SELECT COUNT(*) AS `total`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id` LEFT JOIN `user` ON `user`.`uid` = `item`.`uid`
WHERE `item`.`visible` = 1 AND `item`.`deleted` = 0 and `item`.`moderated` = 0
AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0)
OR `item`.`uid` = %d )
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
- $search_alg ",
- intval(local_user())
+ AND ( `item`.`body` REGEXP '%s' OR `item`.`tag` REGEXP '%s' )",
+ intval(local_user()),
+ dbesc(preg_quote($search)),
+ dbesc('\\]' . preg_quote($search) . '\\[')
);
if(count($r))
@@ -131,9 +128,11 @@ function search_content(&$a) {
AND (( `item`.`allow_cid` = '' AND `item`.`allow_gid` = '' AND `item`.`deny_cid` = '' AND `item`.`deny_gid` = '' AND `item`.`private` = 0 AND `user`.`hidewall` = 0 )
OR `item`.`uid` = %d )
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
- $search_alg
+ AND ( `item`.`body` REGEXP '%s' OR `item`.`tag` REGEXP '%s' )
ORDER BY `received` DESC LIMIT %d , %d ",
intval(local_user()),
+ dbesc(preg_quote($search)),
+ dbesc('\\]' . preg_quote($search) . '\\['),
intval($a->pager['start']),
intval($a->pager['itemspage'])