/**
* 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']));
*/
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;