Filters should be executed even when sql_patches is out-dated
[mailer.git] / doubler.php
index a521ad470903a35cc3c474e34223036fdf5d376f..3a3cb93ba46aaf228ace04231e7d1b766a6a667f 100644 (file)
@@ -64,11 +64,8 @@ if (REQUEST_ISSET_GET(('refid'))) $GLOBALS['refid'] = REQUEST_GET(('refid'));
 
 // Only check this if refid is provided!
 if ($GLOBALS['refid'] > 0) {
-       // Probe for nickname extension and if a nickname was supplied by URL
-       $probe_nickname = ((EXT_IS_ACTIVE('nickname')) && ((''.round($GLOBALS['refid']).'') != $GLOBALS['refid']));
-
        // Do we have nickname or userid set?
-       if ($probe_nickname === true) {
+       if (isNicknameUsed($GLOBALS['refid'])) {
                // Nickname in URL, so load the ID
                $result = SQL_QUERY_ESC("SELECT userid, status FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
                array(bigintval($GLOBALS['refid'])), __FILE__, __LINE__);
@@ -103,8 +100,7 @@ if (isFormSent()) {
        // Begin with doubling process
        if ((REQUEST_ISSET_POST(('userid'))) && (REQUEST_ISSET_POST(('pass'))) && (REQUEST_ISSET_POST(('points')))) {
                // Probe for nickname extension and if a nickname was entered
-               $probe_nickname = ((EXT_IS_ACTIVE('nickname')) && ((''.round(REQUEST_POST('userid')).'') != REQUEST_POST('userid')));
-               if ($probe_nickname) {
+               if (isNickNameUsed(REQUEST_POST('userid'))) {
                        // Nickname in URL, so load the ID
                        $result = SQL_QUERY_ESC("SELECT userid, status, password FROM `{!_MYSQL_PREFIX!}_user_data` WHERE nickname='%s' LIMIT 1",
                        array(REQUEST_POST('userid')), __FILE__, __LINE__);
@@ -186,7 +182,7 @@ if (isFormSent()) {
                } elseif (REQUEST_POST('points') > getConfig('doubler_max')) {
                        // Too much points entered
                        define('__ERROR_MSG', getMessage('DOUBLER_FORM_POINTS_MAX'));
-               } elseif ($probe_nickname) {
+               } elseif (isNickNameUsed(REQUEST_POST('userid'))) {
                        // Cannot resolv nickname -> userid
                        define('__ERROR_MSG', getMessage('DOUBLER_FORM_404_NICKNAME'));
                } else {