]> git.mxchange.org Git - friendica.git/commitdiff
Fix urlpath determination on the root page
authorHypolite Petovan <mrpetovan@gmail.com>
Thu, 12 Jul 2018 02:23:57 +0000 (22:23 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Mon, 16 Jul 2018 23:38:17 +0000 (19:38 -0400)
src/App.php

index 3ce5bf576caff7ef460cdf0796e69e46f4c7edbd..8bde1afc4327ec4301db42d188b0b52e0eb4e26c 100644 (file)
@@ -442,8 +442,14 @@ class App
                 *
                 * To get /path/to/friendica we perform dirname() for as many levels as there are slashes in the QUERY_STRING
                 */
-               if (!empty($_SERVER['SCRIPT_URL']) && !empty($_SERVER['QUERY_STRING'])) {
-                       $path = trim(dirname($_SERVER['SCRIPT_URL'], substr_count(trim($_SERVER['QUERY_STRING'], '/'), '/') + 1), '/');
+               if (!empty($_SERVER['SCRIPT_URL'])) {
+                       // Module
+                       if (!empty($_SERVER['QUERY_STRING'])) {
+                               $path = trim(dirname($_SERVER['SCRIPT_URL'], substr_count(trim($_SERVER['QUERY_STRING'], '/'), '/') + 1), '/');
+                       } else {
+                               // Root page
+                               $path = trim($_SERVER['SCRIPT_URL'], '/');
+                       }
 
                        if ($path && $path != $this->urlpath) {
                                $this->urlpath = $path;