From 2160d5f11f95f81299ae44ece4819c144467d07f Mon Sep 17 00:00:00 2001 From: brettp Date: Mon, 21 Feb 2011 18:30:23 +0000 Subject: Default page owner code now ignores the query. Works for pages like pg/bookmarks/add/34?address=http://google.com git-svn-id: http://code.elgg.org/elgg/trunk@8385 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/pageowner.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'engine/lib') diff --git a/engine/lib/pageowner.php b/engine/lib/pageowner.php index 034349d67..f4f96b0e6 100644 --- a/engine/lib/pageowner.php +++ b/engine/lib/pageowner.php @@ -113,8 +113,17 @@ function default_page_owner_handler($hook, $entity_type, $returnvalue, $params) } $uri = $_SERVER['REQUEST_URI']; - if (strpos($uri, '/pg') === 0) { - $segments = explode('/', $uri); + // ignore the query + $parts = parse_url($uri); + + if ($parts && isset($parts['path'])) { + $path = $parts['path']; + } else { + return $returnvalue; + } + + if (strpos($path, '/pg') === 0) { + $segments = explode('/', $path); if (isset($segments[3]) && isset($segments[4])) { switch ($segments[3]) { case 'owner': -- cgit v1.2.3