From 01894fd8602147cf872979a523d5da9b5b147a53 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 3 Nov 2009 15:52:44 +0000 Subject: [PATCH] Nickname active, but id provided should result in valid refid --- ref.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ref.php b/ref.php index 33b656e747..b308c84198 100644 --- a/ref.php +++ b/ref.php @@ -79,8 +79,18 @@ if (!empty($ref)) { // Load userid list($ref) = SQL_FETCHROW($result); } else { - // No entry found - $ref = 0; + // So do we have a userid? + $result2 = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`='%s' LIMIT 1", + array($ref), __FILE__, __LINE__); + + // Do we have an entry? + if (SQL_NUMROWS($result2) == 0) { + // No entry, so no referal id + $ref = 0; + } // END - if + + // Free result + SQL_FREERESULT($result2); } // Free result -- 2.39.5