Now with refid.php
[mailer.git] / ref.php
diff --git a/ref.php b/ref.php
index 905abf7..c9b37ec 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -64,12 +64,21 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
 
        if (!empty($ref)) {
                // Test if nickname or numeric id
-               if ((EXT_IS_ACTIVE("nickname")) && ($ref != "".bigintval($ref)."")) {
-                       // Nickname in URL, so load the ID
-                       $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' LIMIT 1",
-                               array($ref), __FILE__, __LINE__);
-                       list($ref) = SQL_FETCHROW($result);
-                       SQL_FREERESULT($result);
+               if ($ref != "".bigintval($ref)."") {
+                       if (EXT_IS_ACTIVE("nickname")) {
+                               // Nickname in URL, so load the ID
+                               $result = SQL_QUERY_ESC("SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE nickname='%s' LIMIT 1",
+                                       array($ref), __FILE__, __LINE__);
+
+                               // Load userid
+                               list($ref) = SQL_FETCHROW($result);
+
+                               // Free result
+                               SQL_FREERESULT($result);
+                       } else {
+                               // Invalid request!
+                               $ref = 0;
+                       }
                } // END - if
 
                // Also edit this 0 !