X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FApp%2FBaseURL.php;h=53f65ee55c2e7233f546b87ef31054837484c333;hb=5367620467f690774966c77cf5049ace9e6552a8;hp=501e5fbd3bc32c6846554761e9fb225b1fa43aad;hpb=6e4a428c7394ecb82675ce223a87daf721e6894b;p=friendica.git diff --git a/src/App/BaseURL.php b/src/App/BaseURL.php index 501e5fbd3b..53f65ee55c 100644 --- a/src/App/BaseURL.php +++ b/src/App/BaseURL.php @@ -1,8 +1,27 @@ . + * + */ namespace Friendica\App; -use Friendica\Core\Config\Configuration; +use Friendica\Core\Config\IConfig; use Friendica\Core\System; use Friendica\Util\Network; use Friendica\Util\Strings; @@ -37,7 +56,7 @@ class BaseURL /** * The Friendica Config * - * @var Configuration + * @var IConfig */ private $config; @@ -253,10 +272,10 @@ class BaseURL } /** - * @param Configuration $config The Friendica configuration - * @param array $server The $_SERVER array + * @param IConfig $config The Friendica IConfiguration + * @param array $server The $_SERVER array */ - public function __construct(Configuration $config, array $server) + public function __construct(IConfig $config, array $server) { $this->config = $config; $this->server = $server; @@ -355,7 +374,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 +454,12 @@ class BaseURL $redirectTo = $this->get($ssl) . '/' . ltrim($toUrl, '/'); System::externalRedirect($redirectTo); } + + /** + * Returns the base url as string + */ + public function __toString() + { + return $this->get(); + } }