]> git.mxchange.org Git - friendica.git/blobdiff - src/App/BaseURL.php
Merge remote-tracking branch 'upstream/develop' into item-notification
[friendica.git] / src / App / BaseURL.php
index ea7d9ec74af351b0932025d77cd48073d6fc1c80..7c286514a6206e46747da3def5e3d62486f166d0 100644 (file)
@@ -355,7 +355,7 @@ class BaseURL
                if (!empty($relative_script_path)) {
                        // Module
                        if (!empty($this->server['QUERY_STRING'])) {
-                               $this->urlPath = trim(rdirname($relative_script_path, substr_count(trim($this->server['QUERY_STRING'], '/'), '/') + 1), '/');
+                               $this->urlPath = trim(dirname($relative_script_path, substr_count(trim($this->server['QUERY_STRING'], '/'), '/') + 1), '/');
                        } else {
                                // Root page
                                $this->urlPath = trim($relative_script_path, '/');
@@ -435,4 +435,12 @@ class BaseURL
                $redirectTo = $this->get($ssl) . '/' . ltrim($toUrl, '/');
                System::externalRedirect($redirectTo);
        }
+
+       /**
+        * Returns the base url as string
+        */
+       public function __toString()
+       {
+               return $this->get();
+       }
 }