File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -184,8 +184,8 @@ public function getLangUrl($newlang=null)
184184 if ($ newlang !== null ) {
185185 $ langurl = preg_replace ("#^(.*/)? {$ this ->lang }/# " , "$1 {$ newlang }/ " , $ langurl );
186186 }
187- // make sure that the resulting URL doesn 't contain suspicious characters
188- $ langurl = preg_replace ( " #[^a-zA-Z0-9/-]# " , "" , $ langurl );
187+ // make sure that the resulting URL isn 't interpreted as an absolute URL
188+ $ langurl = str_replace ( " : " , "" , $ langurl );
189189 return $ langurl ;
190190 }
191191
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ public function testGetLangUrlSanitizeSpecialChars() {
237237 $ this ->request ->setServerConstant ('REQUEST_URI ' , '/Skosmos/http://example.com ' );
238238 $ this ->request ->setLang ('en ' );
239239 $ langurl = $ this ->request ->getLangUrl ();
240- $ this ->assertEquals ("http//examplecom " , $ langurl );
240+ $ this ->assertEquals ("http//example.com " , $ langurl );
241241 }
242242
243243}
You can’t perform that action at this time.
0 commit comments