1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-21 16:13:00 +00:00

Bugfix: correctly escape ampersands with htmlentities in URLs

This commit is contained in:
Starbeamrainbowlabs 2020-08-31 21:00:15 +01:00
parent 42971f573d
commit 23998f60bf
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -174,7 +174,7 @@ class page_renderer
// Push the logo via HTTP/2.0 if possible
if($settings->favicon[0] === "/") self::$http2_push_items[] = ["image", $settings->favicon];
$parts = [
"{body}" => $body_template,
@ -439,7 +439,11 @@ class page_renderer
foreach($nav_links as $item) {
if(!is_string($item)) {
// Output the item as a link to a url
$result .= "<span><a href='" . str_replace("{page}", rawurlencode($env->page), $item[1]) . "'>$item[0]</a></span>";
$result .= "<span><a href='" . str_replace(
[ "{page}", "&" ],
[ rawurlencode($env->page), "&amp;" ],
$item[1]
) . "'>$item[0]</a></span>";
continue;
}