]> git.mxchange.org Git - mailer.git/blobdiff - inc/functions.php
- Long variables $HTTP_x_VARS rewritten to short $_x
[mailer.git] / inc / functions.php
index d1dffd29b99c1eb04bfb7dfe199127fa17756e00..c59093bd5004e57c7190a10929cc6e1c0099dc23 100644 (file)
@@ -1646,8 +1646,10 @@ function ADD_EMAIL_NAV($PAGES, $offset, $show_form, $colspan, $return=false) {
 
 //
 function MXCHANGE_OPEN ($script) {
+       //* DEBUG */ print("SCRIPT=".$script."<br />\n");
        // Compile the script name
        $script = COMPILE_CODE($script);
+       //* DEBUG */ print("SCRIPT=".$script."<br />\n");
 
        // Use default SERVER_URL by default... ;) So?
        $url = SERVER_URL;
@@ -1664,10 +1666,20 @@ function MXCHANGE_OPEN ($script) {
        if (ereg("/", $host)) $host = substr($host, 0, strpos($host, "/"));
 
        // Generate relative URL
-       $script = substr($script, (strlen($url) + 7));
+       //* DEBUG */ print("SCRIPT=".$script."<br />\n");
+       if (substr(strtolower($script), 0, 7) == "http://") {
+               // But only if http:// is in front!
+               $script = substr($script, (strlen($url) + 7));
+       } elseif (substr(strtolower($script), 0, 8) == "https://") {
+               // Does this work?!
+               $script = substr($script, (strlen($url) + 8));
+       }
+
+       //* DEBUG */ print("SCRIPT=".$script."<br />\n");
        if (substr($script, 0, 1) == "/") $script = substr($script, 1);
 
        // Open connection
+       //* DEBUG */ die("SCRIPT=".$script."<br />\n");
        $fp = @fsockopen($host, 80, $errno, $errdesc, 30);
        if (!$fp) {
                // Failed!