diff options
author | Thomas Lange <code@nerdmind.de> | 2021-07-22 20:37:46 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-07-22 20:37:46 +0200 |
commit | ae38025d1d03ef3fa12c73b8ea48af3df02e2351 (patch) | |
tree | 5baa9d06c7a5262fe41a2af663a3e6d77581c722 | |
parent | 6342c9a87509fddb3b3ec9046b111bdc2090bc00 (diff) | |
download | blog-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.
-rw-r--r-- | core/functions.php | 1 |
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'); |