]> git.mxchange.org Git - mailer.git/blobdiff - inc/wrapper-functions.php
no more SSL
[mailer.git] / inc / wrapper-functions.php
index 002159c42ae160008726177b5b6e4d396ba2054f..3f7f91ed1166c5cfc01c3e6908454695abe62dcd 100644 (file)
@@ -11,7 +11,7 @@
  * Kurzbeschreibung  : Wrapper-Funktionen                               *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2013 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -293,6 +293,24 @@ function detectServerName () {
        return (getenv('SERVER_NAME'));
 }
 
+// Detects server protocol (http/s)
+function detectServerProtocol () {
+       // Is cache there?
+       if (!isset($GLOBALS[__FUNCTION__])) {
+               // Default is HTTP
+               $GLOBALS[__FUNCTION__] = 'http';
+
+               // Are some specific fields set?
+               if (((isset($_SERVER['HTTPS'])) && (strtolower($_SERVER['HTTPS']) == 'on')) || ((isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'))) {
+                       // Switch to HTTPS
+                       $GLOBALS[__FUNCTION__] = 'https';
+               } // END - if
+       } // END - if
+
+       // Return cached value
+       return $GLOBALS[__FUNCTION__];
+}
+
 // Removes any  existing www. from SERVER_NAME. This is very silly but enough
 // for our purpose here.
 function detectDomainName () {
@@ -1259,6 +1277,8 @@ function getHttpStatus () {
  * @access  private
  */
 function sendRawRedirect ($url) {
+       //* DEBUG-DIE */ die(__METHOD__ . ':url=' . $url);
+
        // Clear output buffer
        clearOutputBuffer();
 
@@ -1276,6 +1296,7 @@ function sendRawRedirect ($url) {
 
        // Revert entity &
        $url = str_replace('&', '&', $url);
+       //* DEBUG-DIE */ die(__METHOD__ . ':url=' . $url);
 
        // check if running on IIS < 6 with CGI-PHP
        if ((isset($_SERVER['SERVER_SOFTWARE'])) && (isset($_SERVER['GATEWAY_INTERFACE'])) &&
@@ -3527,7 +3548,7 @@ function isFilledArray ($array) {
 // Checks whether this script runs on a developer system (called with localhost/127.0.0.1 SERVER_NAME)
 function isDeveloperSystem () {
        // Determine it
-       return in_array(detectServerName(), array('localhost', '127.0.0.1'));
+       return in_array(detectServerName(), array('localhost', 'daedalus', '127.0.0.1'));
 }
 
 // Checks whether given subject line has '_ref' suffix