aboutsummaryrefslogtreecommitdiffstats
path: root/include/widgets.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-03-09 16:25:55 -0700
committerfriendica <info@friendica.com>2015-03-09 16:27:12 -0700
commit26a414fe4b3ab4b1d995233f0402532ad41eaeb7 (patch)
tree40d65dbf107962f987d610a6ef7a16d930804762 /include/widgets.php
parent97df5f1fd193aab92836ef3f9dd854406697b765 (diff)
downloadvolse-hubzilla-26a414fe4b3ab4b1d995233f0402532ad41eaeb7.tar.gz
volse-hubzilla-26a414fe4b3ab4b1d995233f0402532ad41eaeb7.tar.bz2
volse-hubzilla-26a414fe4b3ab4b1d995233f0402532ad41eaeb7.zip
make network page default options work more or less universally instead of just from the navbar, and fix some saved-search weirdness related to the delete-term icon
Diffstat (limited to 'include/widgets.php')
-rw-r--r--include/widgets.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/widgets.php b/include/widgets.php
index 17c740967..243c4a25e 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -233,7 +233,6 @@ function widget_savedsearch($arr) {
$srchurl = rtrim(preg_replace('/searchsave\=[^\&].*?(\&|$)/is','',$srchurl),'&');
$hasq = ((strpos($srchurl,'?') !== false) ? true : false);
$srchurl = rtrim(preg_replace('/searchremove\=[^\&].*?(\&|$)/is','',$srchurl),'&');
- $hasq = ((strpos($srchurl,'?') !== false) ? true : false);
$srchurl = rtrim(preg_replace('/search\=[^\&].*?(\&|$)/is','',$srchurl),'&');
$srchurl = rtrim(preg_replace('/submit\=[^\&].*?(\&|$)/is','',$srchurl),'&');
@@ -241,7 +240,10 @@ function widget_savedsearch($arr) {
$hasq = ((strpos($srchurl,'?') !== false) ? true : false);
+ $hasamp = ((strpos($srchurl,'&') !== false) ? true : false);
+ if(($hasamp) && (! $hasq))
+ $srchurl = substr($srchurl,0,strpos($srchurl,'&')) . '?f=&' . substr($srchurl,strpos($srchurl,'&')+1);
$o = '';
@@ -257,8 +259,8 @@ function widget_savedsearch($arr) {
$saved[] = array(
'id' => $rr['tid'],
'term' => $rr['term'],
- 'dellink' => z_root() . '/' . $srchurl . (($hasq) ? '' : '?f=') . '&amp;searchremove=1&amp;search=' . urlencode($rr['term']),
- 'srchlink' => z_root() . '/' . $srchurl . (($hasq) ? '' : '?f=') . '&amp;search=' . urlencode($rr['term']),
+ 'dellink' => z_root() . '/' . $srchurl . (($hasq || $hasamp) ? '' : '?f=') . '&amp;searchremove=1&amp;search=' . urlencode($rr['term']),
+ 'srchlink' => z_root() . '/' . $srchurl . (($hasq || $hasamp) ? '' : '?f=') . '&amp;search=' . urlencode($rr['term']),
'displayterm' => htmlspecialchars($rr['term'], ENT_COMPAT,'UTF-8'),
'encodedterm' => urlencode($rr['term']),
'delete' => t('Remove term'),