]> git.mxchange.org Git - friendica.git/commitdiff
used ltrim() for removing (any) trailing space
authorRoland Haeder <roland@mxchange.org>
Sat, 25 Mar 2017 20:21:50 +0000 (21:21 +0100)
committerRoland Haeder <roland@mxchange.org>
Sat, 25 Mar 2017 20:22:05 +0000 (21:22 +0100)
Signed-off-by: Roland Haeder <roland@mxchange.org>
boot.php

index 0ed33ad7ecf148fc10daf7b323cbf9feb489e6e4..c9d3045cad3633b0639ad7424fb7d64853eb52be 100644 (file)
--- 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')) {