From b79a12c65fa8548095e367b48ec964e0a7a692a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 16 Jul 2017 19:25:33 +0200 Subject: [PATCH] Let's name it better, more clear. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../config/class_FrameworkConfiguration.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/framework/config/class_FrameworkConfiguration.php b/framework/config/class_FrameworkConfiguration.php index 9736e395..16ebaf86 100644 --- a/framework/config/class_FrameworkConfiguration.php +++ b/framework/config/class_FrameworkConfiguration.php @@ -381,26 +381,27 @@ class FrameworkConfiguration implements Registerable { /** * Detects the HTTPS flag * - * @return $isSecured The detected HTTPS flag or null if failed + * @return $https The detected HTTPS flag or null if failed */ public function detectHttpSecured () { // Default is null - $isSecured = NULL; + $https = NULL; // Is HTTPS set? if ($this->isHttpSecured()) { // Then use it - $isSecured = $_SERVER['HTTPS']; + $https = $_SERVER['HTTPS']; } // END - if // Return it - return $isSecured; + return $https; } /** * Checks whether HTTPS is set in $_SERVER * - * @return $isset Whether HTTPS is set + * @return $isset Whether HTTPS is set + * @todo Test more fields */ public function isHttpSecured () { return (isset($_SERVER['HTTPS'])); @@ -413,16 +414,16 @@ class FrameworkConfiguration implements Registerable { */ public function detectBaseUrl () { // Initialize the URL - $baseUrl = 'http'; + $protocol = 'http'; // Do we have HTTPS? if ($this->isHttpSecured()) { // Add the >s< for HTTPS - $baseUrl .= 's'; + $protocol = 's'; } // END - if // Construct the full URL and secure it against CSRF attacks - $baseUrl = $baseUrl . '://' . $this->detectDomain() . $this->detectScriptPath(); + $baseUrl = $protocol . '://' . $this->detectDomain() . $this->detectScriptPath(); // Return the URL return $baseUrl; -- 2.39.5