mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
Some updates... username updates are now finished (no more changing here). Please review the changes to search.php (at the moment not active).
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@4066 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -81,7 +81,15 @@ function get_userdata($user, $force_str = false)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$user = ((intval($user) == 0) || ($force_str)) ? str_replace("\'", "''", htmlspecialchars(trim($user))) : intval($user);
|
||||
if (intval($user) == 0 || $force_str)
|
||||
{
|
||||
$user = trim(htmlspecialchars($user));
|
||||
$user = substr(str_replace("\'", "'", $user), 0, 25);
|
||||
}
|
||||
else
|
||||
{
|
||||
$user = intval($user);
|
||||
}
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM " . USERS_TABLE . "
|
||||
|
@@ -102,8 +102,8 @@ function validate_username($username)
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Don't allow " in username.
|
||||
if (strstr($username, '"') || strstr($username, '"'))
|
||||
// Don't allow " and ALT-255 in username.
|
||||
if (strstr($username, '"') || strstr($username, '"') || strstr($username, chr(160)))
|
||||
{
|
||||
return array('error' => true, 'error_msg' => $lang['Username_invalid']);
|
||||
}
|
||||
|
Reference in New Issue
Block a user