From ae38025d1d03ef3fa12c73b8ea48af3df02e2351 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 22 Jul 2021 20:37:46 +0200 Subject: Bugfix: Escape "%" in URL params for sprintf Escape possible percent characters ("%") in the URL params for sprintf. Otherwise the pagination template breaks if URL params which contain a percent sign are merged into the pagination URL. --- core/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/functions.php b/core/functions.php index 38af934..d5b56a2 100644 --- a/core/functions.php +++ b/core/functions.php @@ -18,6 +18,7 @@ use Parsers\MarkdownParser; #=============================================================================== function createPaginationTemplate($current, $last, string $location): Template { $params = http_build_query(array_merge($_GET, ['site' => '__SITE__'])); + $params = str_replace('%', '%%', $params); $params = str_replace('__SITE__', '%d', $params); $Pagination = TemplateFactory::build('pagination'); -- cgit v1.2.3