Refback will be payed now (user cannot setup currently)
[mailer.git] / inc / modules / loader.php
index 96e1bc8a3ae42ef25b01957d47026bad6b1f432a..ab8533a79b1382f876e8bcade550e6bd6a1a04df 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
 
-if (!empty($_GET['url']))
-{
-       $url = base64_decode(urldecode(COMPILE_CODE($_GET['url'])));
-       if (VALIDATE_URL($url))
-       {
+if (!empty($_GET['url'])) {
+       // Decode URL
+       $url = gzuncompress(base64_decode(str_replace(" ", "+", COMPILE_CODE(urldecode($_GET['url'])))));
+
+       // Validate the URL
+       if (VALIDATE_URL($url)) {
                // Prepare data for the template
                define('__URL', $url);
 
                // Generate a JavaScript that redirects us
                LOAD_TEMPLATE("loader");
-       }
-        else
-       {
+       } else {
                // URL invalid
                LOAD_URL("index.php");
        }
-}
- else
-{
+} else {
        // Invalid or no URL entered!
        LOAD_URL("index.php");
 }
+
 //
 ?>