__FUNCTION__, __LINE__);
// Remember insert id for other filters
- $filterData['history_id'] = SQL_INSERT_ID();
+ $filterData['history_id'] = SQL_INSERTID();
// Return data
return $filterData;
} // END - if
// Set from header
- if ((!isInStringIgnoreCase('@', $toEmail)) && ($toEmail > 0)) {
+ if ((!isInStringIgnoreCase('@', str_replace('{AT}', '@', $toEmail))) && ($toEmail > 0)) {
// Does the user exist?
if ((isExtensionActive('user')) && (fetchUserData($toEmail))) {
// Get the email
// Create email link to admins's account
function generateAdminEmailLink ($email, $mod = 'admin') {
// Is it an email?
- if (strpos($email, '@') !== false) {
+ if (strpos(str_replace('{AT}', '@', $email), '@') !== false) {
// Create email link
$result = SQL_QUERY_ESC("SELECT `id`
FROM
`{?_MYSQL_PREFIX?}_admins`
WHERE
- `email`='%s'
+ '%s' REGEXP `email`
LIMIT 1",
array($email), __FUNCTION__, __LINE__);
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
WHERE
- `email`='%s'" . $locked."
+ '%s' REGEXP `email`
+ " . $locked . "
LIMIT 1",
array($email), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
switch ($status) {
case 'added': // Sponsor successfully added with account status = UNCONFIRMED!
// Check for his id number
- $result = SQL_QUERY_ESC("SELECT `id`,`hash` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE `email`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`,`hash` FROM `{?_MYSQL_PREFIX?}_sponsor_data` WHERE '%s' REGEXP `email` LIMIT 1",
array(postRequestParameter('email')), __FUNCTION__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// id found so let's load it for the confirmation email
$locked = " AND `status`='CONFIRMED'";
// But admins shall always see it
- if (isAdmin()) $locked = '';
+ if (isAdmin()) {
+ $locked = '';
+ } // END - if
+ // Search for the email address
$result = SQL_QUERY_ESC("SELECT
`userid`
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
- `email`='%s'" . $locked."
+ '%s' REGEXP `email`
+ " . $locked . "
LIMIT 1",
array($email), __FUNCTION__, __LINE__);
+
+ // Do we have an entry?
if (SQL_NUMROWS($result) == 1) {
// Load userid
list($userid) = SQL_FETCHROW($result);
$OUT = '';
// Look up administator login
- $result = SQL_QUERY_ESC("SELECT `id`,`login`,`password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE `email`='%s' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `id`,`login`,`password` FROM `{?_MYSQL_PREFIX?}_admins` WHERE '%s' REGEXP `email` LIMIT 1",
array($email), __FUNCTION__, __LINE__);
// Is there an account?
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
WHERE
- `email`='%s' AND
+ '%s' REGEXP `email` AND
(`status`='UNCONFIRMED' OR `status`='EMAIL')
LIMIT 1",
array(postRequestParameter('email')), __FILE__, __LINE__);
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
WHERE
- `email`='%s' AND
+ '%s' REGEXP `email` AND
`id`=%s AND
`status`='CONFIRMED'
LIMIT 1",