diff options
-rw-r--r-- | Zotlabs/Lib/Activity.php | 21 |
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; |