From: Roland Häder Date: Tue, 17 Nov 2009 20:46:10 +0000 (+0000) Subject: Hack for old/new mixtures in email addresses ('{DOT}' vs. '.') X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=788a9ea4259381bb4216f77c1ab2341ed36c66dd;p=mailer.git Hack for old/new mixtures in email addresses ('{DOT}' vs. '.') --- diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 8e1435575b..75d9fe3de1 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -39,13 +39,13 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} +} // END - if // Add links for selecting some users function alpha ($sortby, $colspan, $return=false) { if (!isGetRequestElementSet('offset')) setRequestGetElement('offset', 0); - $add = "&page=".getRequestElement('page')."&offset=".getRequestElement('offset'); - if (isGetRequestElementSet('mode')) $add .= "&mode=".getRequestElement('mode'); + $add = '&page='.getRequestElement('page').'&offset='.getRequestElement('offset'); + if (isGetRequestElementSet('mode')) $add .= '&mode='.getRequestElement('mode'); /* Creates the list of letters and makes them a link. */ $alphabet = explode(',', getMessage('_ALL2') . ',A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,' . getMessage('_OTHERS')); @@ -54,18 +54,18 @@ function alpha ($sortby, $colspan, $return=false) { while (list($counter, $ltr) = each($alphabet)) { if (getRequestElement('letter') == $ltr) { // Current letter is letter from URL - $OUT .= "".$ltr.""; + $OUT .= '' . $ltr . ''; } else { // Output link to letter - $OUT .= "".$ltr.""; + $OUT .= '' . $ltr . ''; } if ((($counter / getConfig('user_alpha')) == round($counter / getConfig('user_alpha'))) && ($counter > 0)) { - $OUT .= " ]
[ "; + $OUT .= ' ]
[ '; } elseif ( $counter != $num ) { - $OUT .= " | "; + $OUT .= ' | '; } } // END - while @@ -111,9 +111,9 @@ function addSortLinks ($letter, $sortby, $colspan, $return=false) { foreach ($list as $sort => $title) { if ($sortby == $sort) { - $OUT .= "" . $title . " | "; + $OUT .= '' . $title . ' | '; } else { - $OUT .= "" . $title . " | "; + $OUT .= '' . $title . ' | '; } } // END - foreach @@ -406,9 +406,6 @@ function doUserLogin ($userid, $passwd, $successUrl = '', $errorUrl = 'modules.p // Try to send a new password for the given user account function doNewUserPassword ($email, $userid) { - // Compile email when found in address (only secure chars!) - if (!empty($email)) $email = str_replace('{DOT}', '.', $email); - // Init result and error $errorCode = ''; $result = false; @@ -417,8 +414,8 @@ function doNewUserPassword ($email, $userid) { // @TODO We should try to rewrite this to fetchUserData() somehow if (!empty($email)) { // Email entered - $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email`='%s' LIMIT 1", - array($email), __FUNCTION__, __LINE__); + $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email`='%s' OR `email`='%s' LIMIT 1", + array($email, str_replace('.', '{DOT}', $email)), __FUNCTION__, __LINE__); } elseif ((isExtensionActive('nickname')) && (isNicknameOrUserid($userid))) { // Nickname entered $result = SQL_QUERY_ESC("SELECT `userid`, `status` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `nickname`='%s' OR `userid`='%s' OR `email`='%s' LIMIT 1",