diff options
author | Mario <mario@mariovavti.com> | 2022-12-02 17:46:42 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-12-02 17:46:42 +0000 |
commit | 6f0979614222f562ecf5a8e90f914126c9eaf9eb (patch) | |
tree | 64b72ea3d10ac21e316930141414c36234cf8140 /Zotlabs/Widget | |
parent | d16b6c3838cd76eb7ce336444cbd37774857b64f (diff) | |
parent | 2de2c8e207aae66280a7be6bccfe64558534a54e (diff) | |
download | volse-hubzilla-6f0979614222f562ecf5a8e90f914126c9eaf9eb.tar.gz volse-hubzilla-6f0979614222f562ecf5a8e90f914126c9eaf9eb.tar.bz2 volse-hubzilla-6f0979614222f562ecf5a8e90f914126c9eaf9eb.zip |
Merge branch 'fix-category-widget-urls' into 'dev'
Fix Category widget URLs
See merge request hubzilla/core!2030
Diffstat (limited to 'Zotlabs/Widget')
-rw-r--r-- | Zotlabs/Widget/Categories.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index b31856e48..b0eda253b 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -24,15 +24,16 @@ class Categories { } $cat = ((x($_REQUEST, 'cat')) ? htmlspecialchars($_REQUEST['cat'], ENT_COMPAT, 'UTF-8') : ''); - $srchurl = App::$query_string; - $srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is', '', $srchurl), '&'); - $srchurl = str_replace(['?f=','&f=', '/?'], ['', '', ''], $srchurl); + + // Discard queries from the current URL, as the template expects a base + // URL without any queries. + $base = substr(App::$query_string, 0, strcspn(App::$query_string, '?')); if($files) { - return filecategories_widget($srchurl, $cat); + return filecategories_widget($base, $cat); } - return categories_widget($srchurl, $cat); + return categories_widget($base, $cat); } } |