mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Fix Bug #57755 - Make user_email_hash() function independent from system's architecture.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10499 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
68cac354aa
commit
30b83896a1
4 changed files with 34 additions and 3 deletions
|
@ -172,6 +172,7 @@
|
||||||
<li>[Fix] Fix problems with firebird by no longer using 'count' as a column alias. (Bug #57455)</li>
|
<li>[Fix] Fix problems with firebird by no longer using 'count' as a column alias. (Bug #57455)</li>
|
||||||
<li>[Fix] Small language correction for the FAQ page. (Bug #57825)</li>
|
<li>[Fix] Small language correction for the FAQ page. (Bug #57825)</li>
|
||||||
<li>[Fix] Restrict search for language/../iso.txt to folders. (Bug #57795)</li>
|
<li>[Fix] Restrict search for language/../iso.txt to folders. (Bug #57795)</li>
|
||||||
|
<li>[Fix] Make user_email_hash() function independent from system's architecture. (Bug #57755)</li>
|
||||||
<li>[Change] Move redirect into a hidden field to avoid issues with mod_security. (Bug #54145)</li>
|
<li>[Change] Move redirect into a hidden field to avoid issues with mod_security. (Bug #54145)</li>
|
||||||
<li>[Change] Log activation through inactive users ACP. (Bug #30145)</li>
|
<li>[Change] Log activation through inactive users ACP. (Bug #30145)</li>
|
||||||
<li>[Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)</li>
|
<li>[Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)</li>
|
||||||
|
|
|
@ -556,11 +556,11 @@ function _hash_crypt_private($password, $setting, &$itoa64)
|
||||||
*
|
*
|
||||||
* @param string $email Email address
|
* @param string $email Email address
|
||||||
*
|
*
|
||||||
* @return string Big Integer
|
* @return string Unsigned Big Integer
|
||||||
*/
|
*/
|
||||||
function phpbb_email_hash($email)
|
function phpbb_email_hash($email)
|
||||||
{
|
{
|
||||||
return crc32(strtolower($email)) . strlen($email);
|
return sprintf('%u', crc32(strtolower($email))) . strlen($email);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -205,10 +205,12 @@ function get_group_id($group_name)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate the email hash stored in the users table
|
* Generate the email hash stored in the users table
|
||||||
|
*
|
||||||
|
* Note: Deprecated, calls should directly go to phpbb_email_hash()
|
||||||
*/
|
*/
|
||||||
function gen_email_hash($email)
|
function gen_email_hash($email)
|
||||||
{
|
{
|
||||||
return (crc32(strtolower($email)) . strlen($email));
|
return phpbb_email_hash($email);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1603,6 +1603,34 @@ function change_database_data(&$no_updates, $version)
|
||||||
|
|
||||||
// No changes from 3.0.7-RC1 to 3.0.7
|
// No changes from 3.0.7-RC1 to 3.0.7
|
||||||
case '3.0.7-RC1':
|
case '3.0.7-RC1':
|
||||||
|
|
||||||
|
$sql = 'SELECT user_id, user_email, user_email_hash
|
||||||
|
FROM ' . USERS_TABLE . '
|
||||||
|
WHERE user_type <> ' . USER_IGNORE . "
|
||||||
|
AND user_email <> ''";
|
||||||
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
while ($row = $db->sql_fetchrow($result))
|
||||||
|
{
|
||||||
|
$user_email_hash = phpbb_email_hash($row['user_email']);
|
||||||
|
|
||||||
|
if ($user_email_hash != $row['user_email_hash'])
|
||||||
|
{
|
||||||
|
$sql_ary = array(
|
||||||
|
'user_email_hash' => $user_email_hash,
|
||||||
|
);
|
||||||
|
|
||||||
|
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||||
|
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||||
|
WHERE user_id = ' . (int) $row['user_id'];
|
||||||
|
__sql($sql, $errored, $error_ary, ($i % 100 == 0));
|
||||||
|
|
||||||
|
++$i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue