final fix for banner loader
authorRoland Häder <roland@mxchange.org>
Sat, 2 Feb 2008 13:05:53 +0000 (13:05 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 2 Feb 2008 13:05:53 +0000 (13:05 +0000)
0.2.1/inc/functions.php
0.2.1/view.php

index e3bbf34..58b69a2 100644 (file)
@@ -992,12 +992,12 @@ function MAKE_TIME($H, $M, $S, $stamp)
        return mktime($H, $M, $S, $MONTH, $DAY, $YEAR);
 }
 //
-function LOAD_URL($URL) {
+function LOAD_URL($URL, $addUrlData=true) {
        // Compile out URI codes
        $URL = COMPILE_CODE($URL);
 
        // Add some data to URL if cookies are not accepted
-       if ((!defined('__COOKIES')) || (!__COOKIES)) $URL = ADD_URL_DATA($URL);
+       if ((!defined('__COOKIES')) || (!__COOKIES) && ($addUrlData)) $URL = ADD_URL_DATA($URL);
 
        // Probe for bot from search engine
        if ((eregi("spider", getenv('HTTP_USER_AGENT'))) || (eregi("bot", getenv('HTTP_USER_AGENT'))) || (eregi("spider", getenv('HTTP_USER_AGENT')))) {
@@ -1997,23 +1997,28 @@ function ADD_URL_DATA($URL)
 {
        global $_GET, $CONFIG;
        $ADD = "";
+
+       // Determine URL binder
+       $BIND = "?";
+       if (strpos($URL, "?") !== false) $BIND = "&";
+
        if ((!defined('__COOKIES')) || ((!__COOKIES))) {
                // Cookies are not accepted
                if ((!empty($_GET['refid'])) && (strpos($URL, "refid=") == 0)) {
                        // Cookie found in URL
-                       $ADD .= "&refid=".bigintval($_GET['refid']);
+                       $ADD .= $BIND."refid=".bigintval($_GET['refid']);
                } elseif ((GET_EXT_VERSION("sql_patches") != "") && ($CONFIG['def_refid'] > 0)) {
                        // Not found! So let's set default here
-                       $ADD .= "&refid=".$CONFIG['def_refid'];
+                       $ADD .= $BIND."refid=".$CONFIG['def_refid'];
                }
 
                // Add session ID
                if ((!empty($_GET['PHPSESSID'])) && (strpos($URL, "PHPSESSID=") == 0)) {
                        // Add session from URL
-                       $ADD .= "&PHPSESSID=".SQL_ESCAPE(strip_tags($_GET['PHPSESSID']));
+                       $ADD .= $BIND."PHPSESSID=".SQL_ESCAPE(strip_tags($_GET['PHPSESSID']));
                } else {
                        // Add current session
-                       $ADD .= "&PHPSESSID=".session_id();
+                       $ADD .= $BIND."PHPSESSID=".session_id();
                }
        }
 
index 66eff3c..f454e64 100644 (file)
@@ -59,7 +59,7 @@ if (((!empty($_GET['user'])) || (!empty($_GET['reseller']))) && (!empty($_GET['b
 
                $type = substr($url, -3);
                header ("Content-Type: image/".$type);
-               LOAD_URL($url);
+               LOAD_URL($url, false);
        } else {
                // Free memory
                SQL_FREERESULT($result);