File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -94,17 +94,30 @@ public function getURL()
9494 if ($ this ->pageObjectID ) {
9595 $ handler = $ this ->getMenuPageHandler ();
9696 if ($ handler && $ handler instanceof ILookupPageHandler) {
97- return $ handler ->getLink ($ this ->pageObjectID ) . $ this -> urlParameters ;
97+ return $ this -> appendUrlParameters ( $ handler ->getLink ($ this ->pageObjectID )) ;
9898 }
9999 }
100100
101101 if ($ this ->pageID ) {
102- return $ this ->getPage ()->getLink () . $ this -> urlParameters ;
102+ return $ this ->appendUrlParameters ( $ this -> getPage ()->getLink ()) ;
103103 } else {
104104 return WCF ::getLanguage ()->get ($ this ->externalURL );
105105 }
106106 }
107107
108+ private function appendUrlParameters (string $ url ): string
109+ {
110+ if (!$ this ->urlParameters ) {
111+ return $ url ;
112+ }
113+
114+ if (\str_contains ($ url , '? ' )) {
115+ return $ url .= '& ' . $ this ->urlParameters ;
116+ }
117+
118+ return $ url .= '? ' . $ this ->urlParameters ;
119+ }
120+
108121 /**
109122 * Returns the page that is linked by this menu item.
110123 *
You can’t perform that action at this time.
0 commit comments