From: Roland Häder Date: Fri, 29 Jul 2011 00:54:04 +0000 (+0000) Subject: Members can now no longer enter 'NULL' as their nickname X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ebebf74b951f64a41c14d0bdb44368a96721ddbe;p=mailer.git Members can now no longer enter 'NULL' as their nickname --- diff --git a/doubler.php b/doubler.php index e62f1583c3..99ab704236 100644 --- a/doubler.php +++ b/doubler.php @@ -67,7 +67,7 @@ if (isFormSent()) { // Begin with doubling process if ((isPostRequestParameterSet('userid')) && (isPostRequestParameterSet('password')) && (isPostRequestParameterSet('points'))) { // Probe for nickname extension and if a nickname was entered - if (isNickNameUsed(postRequestParameter('userid'))) { + if (isNicknameUsed(postRequestParameter('userid'))) { // Nickname in URL, so load the id fetchUserData(postRequestParameter('userid'), 'nickname'); } else { @@ -152,7 +152,7 @@ if (isFormSent()) { } elseif (postRequestParameter('points') > getConfig('doubler_max')) { // Too much points entered $content['message'] = '{--DOUBLER_FORM_POINTS_MAX--}'; - } elseif (isNickNameUsed(postRequestParameter('userid'))) { + } elseif (isNicknameUsed(postRequestParameter('userid'))) { // Cannot resolv nickname -> userid $content['message'] = '{--DOUBLER_FORM_404_NICKNAME--}'; } else { diff --git a/inc/modules/member/what-nickname.php b/inc/modules/member/what-nickname.php index f3b1485269..58c3db924a 100644 --- a/inc/modules/member/what-nickname.php +++ b/inc/modules/member/what-nickname.php @@ -58,7 +58,7 @@ if (isFormSent()) { // Check if nickname is valid if (preg_match('/[' . getConfig('nickname_pattern') . ']{' . getConfig('nickname_len') . ',}/', postRequestParameter('nickname'), $array)) { // Entered nickname is valid? - $isValid = ($array[0] == postRequestParameter('nickname')); + $isValid = (($array[0] == postRequestParameter('nickname')) && (isNicknameUsed(postRequestParameter('nickname')))); } // END - if } // END - if } // END - if diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index fe44a0b7d1..548aa6562e 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -559,7 +559,7 @@ function isNicknameUsed ($userid) { // Is the cache there if (!isset($GLOBALS[__FUNCTION__][$userid])) { // Determine it - $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . round($userid) . '') != $userid)); + $GLOBALS[__FUNCTION__][$userid] = ((!empty($userid)) && (('' . round($userid) . '') != $userid) && ($userid != 'NULL')); } // END - if // Return the result diff --git a/templates/de/html/guest/guest_register_refid_hide.tpl b/templates/de/html/guest/guest_register_refid_hide.tpl index d12812bbaa..aa1eb38d8b 100644 --- a/templates/de/html/guest/guest_register_refid_hide.tpl +++ b/templates/de/html/guest/guest_register_refid_hide.tpl @@ -4,6 +4,6 @@ {%pipe,determineReferalId%} - +