aboutsummaryrefslogtreecommitdiffstats
path: root/core/functions.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-07-22 20:37:46 +0200
committerThomas Lange <code@nerdmind.de>2021-07-22 20:37:46 +0200
commitae38025d1d03ef3fa12c73b8ea48af3df02e2351 (patch)
tree5baa9d06c7a5262fe41a2af663a3e6d77581c722 /core/functions.php
parent6342c9a87509fddb3b3ec9046b111bdc2090bc00 (diff)
downloadblog-ae38025d1d03ef3fa12c73b8ea48af3df02e2351.tar.gz
blog-ae38025d1d03ef3fa12c73b8ea48af3df02e2351.tar.xz
blog-ae38025d1d03ef3fa12c73b8ea48af3df02e2351.zip
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.
Diffstat (limited to 'core/functions.php')
-rw-r--r--core/functions.php1
1 files changed, 1 insertions, 0 deletions
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');