From 6cb81f6e474c3b904e5c759ee96e7fac115050e9 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 19 Sep 2013 21:36:22 -0700 Subject: use &safe=-1 for unsafe only --- mod/dirsearch.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 "; -- cgit v1.2.3