From fda99e39c147d97e038e1bd8e141a7ea5c64a3ec Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sat, 25 Mar 2017 21:21:50 +0100 Subject: [PATCH] used ltrim() for removing (any) trailing space Signed-off-by: Roland Haeder --- boot.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/boot.php b/boot.php index 0ed33ad7ec..c9d3045cad 100644 --- a/boot.php +++ b/boot.php @@ -695,18 +695,14 @@ class App { if ((x($_SERVER, 'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'], 0, 9) === "pagename=") { $this->query_string = substr($_SERVER['QUERY_STRING'], 9); + // removing trailing / - maybe a nginx problem - /// @TODO can be shortened by trim($str, '/') ! - if (substr($this->query_string, 0, 1) == "/") { - $this->query_string = substr($this->query_string, 1); - } + $this->query_string = lrim($this->query_string, '/'); } elseif ((x($_SERVER, 'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'], 0, 2) === "q=") { $this->query_string = substr($_SERVER['QUERY_STRING'],2); + // removing trailing / - maybe a nginx problem - /// @TODO can be shortened by trim($str, '/') ! - if (substr($this->query_string, 0, 1) == "/") { - $this->query_string = substr($this->query_string, 1); - } + $this->query_string = lrim($this->query_string, '/'); } if (x($_GET, 'pagename')) {