aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon L'nu <simon.lnu@gmail.com>2012-03-31 03:42:19 -0400
committerSimon L'nu <simon.lnu@gmail.com>2012-03-31 03:42:19 -0400
commite940acf8c68ac72a2f55590306977e00f1523f2a (patch)
treea1329a52429aadf823da3d1a5199f29cda5da331
parent301527e5a269d652059bd73172a3a3598287ff9d (diff)
parent8c928e67ba9f122343f53400cf0f4dae8104ffd7 (diff)
downloadvolse-hubzilla-e940acf8c68ac72a2f55590306977e00f1523f2a.tar.gz
volse-hubzilla-e940acf8c68ac72a2f55590306977e00f1523f2a.tar.bz2
volse-hubzilla-e940acf8c68ac72a2f55590306977e00f1523f2a.zip
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
* remotes/upstream/master: warning cleanup * master:
-rw-r--r--include/text.php1
-rwxr-xr-xmod/search.php15
2 files changed, 7 insertions, 9 deletions
diff --git a/include/text.php b/include/text.php
index 0b825cc39..f758c37ee 100644
--- a/include/text.php
+++ b/include/text.php
@@ -205,7 +205,6 @@ function hex2bin($s) {
return '';
if(! ctype_xdigit($s)) {
- logger('hex2bin: illegal input: ' . print_r(debug_backtrace(), true));
return($s);
}
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'])