summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThilo Wawrzik2007-10-19 12:38:53 (GMT)
committer Thilo Wawrzik2007-10-19 12:38:53 (GMT)
commitd93af0049b492607841709e5f935871a688cdd5b (patch)
treebdee862a8371710f609463d69588324ffd67aec5
parentd72821ef0a8ee3390543da6851e45f697edc98eb (diff)
- bugfix: strip off additional url arguments like session id (#181703)
-rw-r--r--gallery_menu/gallery_menu.module9
1 files changed, 7 insertions, 2 deletions
diff --git a/gallery_menu/gallery_menu.module b/gallery_menu/gallery_menu.module
index a218f07..5ea21d3 100644
--- a/gallery_menu/gallery_menu.module
+++ b/gallery_menu/gallery_menu.module
@@ -153,9 +153,14 @@ function _gallery_menu_traverse(&$tree, &$items) {
*/
function _gallery_menu_album_path($id) {
$path = urldecode(gallery_generate_url(array('itemId' => $id), FALSE, FALSE));
- $path = rtrim(substr($path, strlen(base_path())), '/');
+ // Strip off the base path ...
+ $path = substr($path, strlen(base_path()));
+ // ... and additional parameter (e.g. session id, etc.)
+ if (($pos = strrpos($path, '/')) !== FALSE) {
+ $path = substr($path, 0, $pos + 1);
+ }
- return $path;
+ return rtrim($path, '/');
}
/**