aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-02-11 21:00:10 +0000
committerMario <mario@mariovavti.com>2021-02-11 21:00:10 +0000
commitd3e70acacd9576fbe1aaa3e12a64966eb79fac29 (patch)
tree95d42c992d0aa61349c6998b2c484ce71b061004 /Zotlabs
parent6f520cadb7dd34c551e20ff32e8c8f6335824a8a (diff)
downloadvolse-hubzilla-d3e70acacd9576fbe1aaa3e12a64966eb79fac29.tar.gz
volse-hubzilla-d3e70acacd9576fbe1aaa3e12a64966eb79fac29.tar.bz2
volse-hubzilla-d3e70acacd9576fbe1aaa3e12a64966eb79fac29.zip
make encode_item_collection() deal with extra query args
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Activity.php21
1 files changed, 16 insertions, 5 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 3965aa1e3..780dd26b4 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -275,17 +275,27 @@ class Activity {
$numpages = $total / App::$pager['itemspage'];
$lastpage = (($numpages > intval($numpages)) ? intval($numpages) + 1 : $numpages);
+ $url_parts = parse_url($id);
- $stripped = preg_replace('/([&|\?]page=[0-9]*)/', '', $id);
- $stripped = rtrim($stripped, '/');
+ $ret['partOf'] = z_root() . '/' . $url_parts['path'];
- $ret['partOf'] = z_root() . '/' . $stripped;
+ $extra_query_args = '';
+ $query_args = null;
+ if(isset($url_parts['query'])) {
+ parse_str($url_parts['query'], $query_args);
+ }
+
+ if(is_array($query_args)) {
+ unset($query_args['page']);
+ foreach($query_args as $k => $v)
+ $extra_query_args .= '&' . urlencode($k) . '=' . urlencode($v);
+ }
if (App::$pager['page'] < $lastpage) {
- $ret['next'] = z_root() . '/' . $stripped . '?page=' . (intval(App::$pager['page']) + 1);
+ $ret['next'] = z_root() . '/' . $url_parts['path'] . '?page=' . (intval(App::$pager['page']) + 1) . $extra_query_args;
}
if (App::$pager['page'] > 1) {
- $ret['prev'] = z_root() . '/' . $stripped . '?page=' . (intval(App::$pager['page']) - 1);
+ $ret['prev'] = z_root() . '/' . $url_parts['path'] . '?page=' . (intval(App::$pager['page']) - 1) . $extra_query_args;
}
}
else {
@@ -1489,6 +1499,7 @@ class Activity {
}
static function actor_store($url, $person_obj) {
+ hz_syslog('actor_store: ' . $url);
if (!is_array($person_obj))
return;