From 8616aff4401353067554a32e48778454b80f7361 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Wed, 18 Oct 2017 18:21:44 +0200 Subject: [PATCH] Bug fixes https://github.com/bludit/bludit/issues/507 --- bl-kernel/dbsite.class.php | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/bl-kernel/dbsite.class.php b/bl-kernel/dbsite.class.php index 0c72cdf8..273566cc 100644 --- a/bl-kernel/dbsite.class.php +++ b/bl-kernel/dbsite.class.php @@ -202,20 +202,15 @@ class dbSite extends dbJSON return $protocol.$domain; } - // Parse the domain from the field URL. + // Parse the domain from the field url (Settings->Advanced) $parse = parse_url($this->url()); - $domain = trim($parse['host'], '/'); + $domain = rtrim($parse['host'], '/'); + $port = !empty($parse['port']) ? ':'.$parse['port'] : ''; + $scheme = !empty($parse['scheme']) ? $parse['scheme'].'://' : 'http://'; - return $parse['scheme'].'://'.$domain; + return $scheme.$domain.$port; } -/* DEPRECATED - // Returns the relative home link - public function homeLink() - { - return HTML_PATH_ROOT; - } -*/ // Returns the timezone. public function timezone() { @@ -246,17 +241,6 @@ class dbSite extends dbJSON return $this->getField('locale'); } -/* DEPRECATED - // Returns the current language in short format - public function shortLanguage() - { - $locale = $this->locale(); - $explode = explode('_', $locale); - $short = array_shift($explode); - - return $short; - } -*/ // Returns the current homepage, FALSE if not defined homepage public function homepage() {