aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-19 21:36:22 -0700
committerfriendica <info@friendica.com>2013-09-19 21:36:22 -0700
commit6cb81f6e474c3b904e5c759ee96e7fac115050e9 (patch)
treeac8ffd5fd5c8e596f6847f20df378b6bccbe23d5
parent876a9d1850ec6fc2aa26f530e8ab554028158734 (diff)
downloadvolse-hubzilla-6cb81f6e474c3b904e5c759ee96e7fac115050e9.tar.gz
volse-hubzilla-6cb81f6e474c3b904e5c759ee96e7fac115050e9.tar.bz2
volse-hubzilla-6cb81f6e474c3b904e5c759ee96e7fac115050e9.zip
use &safe=-1 for unsafe only
-rw-r--r--mod/dirsearch.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index a92134942..fc0ac4fe3 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -41,6 +41,7 @@ function dirsearch_content(&$a) {
$agege = ((x($_REQUEST,'agege')) ? intval($_REQUEST['agege']) : 0 );
$agele = ((x($_REQUEST,'agele')) ? intval($_REQUEST['agele']) : 0 );
$kw = ((x($_REQUEST,'kw')) ? intval($_REQUEST['kw']) : 0 );
+
// by default use a safe search
$safe = ((x($_REQUEST,'safe')) ? intval($_REQUEST['safe']) : 1 );
@@ -101,7 +102,9 @@ function dirsearch_content(&$a) {
$logic = ((strlen($sql_extra)) ? 0 : 1);
- $safesql = (($safe) ? " and not ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED) . " ) " : '');
+ $safesql = (($safe > 0) ? " and not ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED) . " ) " : '');
+ if($safe < 0)
+ $safesql = " and ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED) . " ) ";
if($limit)
$qlimit = " LIMIT $limit ";