From f9e9642c22628b656b0c21554a97418d62c5d97b Mon Sep 17 00:00:00 2001 From: Daniel Rudolf Date: Sun, 8 Nov 2015 14:01:35 +0100 Subject: [PATCH] Fix Pico::getPageUrl() With enabled URL rewriting we must call rawurlencode() on the file path parts rather the whole path --- lib/Pico.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Pico.php b/lib/Pico.php index 674d526..4284de8 100644 --- a/lib/Pico.php +++ b/lib/Pico.php @@ -1187,7 +1187,13 @@ class Pico */ public function getPageUrl($page) { - return $this->getBaseUrl() . ((!$this->isUrlRewritingEnabled() && !empty($page)) ? '?' : '') . rawurlencode($page); + if (empty($page)) { + return $this->getBaseUrl(); + } elseif (!$this->isUrlRewritingEnabled()) { + return $this->getBaseUrl() . '?' . rawurlencode($page); + } else { + return $this->getBaseUrl() . implode('/', array_map('rawurlencode', explode('/', $page))); + } } /**