diff --git a/gallery_menu/gallery_menu.module b/gallery_menu/gallery_menu.module index a218f07e313e371a1431198152819583fbd987cd..5ea21d354a558960955a1aa9370a3a2d4807bc30 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, '/'); } /**