1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 16:27:38 +02:00
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5028 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2004-11-18 17:49:48 +00:00
parent 9ba371aa0e
commit c835b7e909
26 changed files with 1699 additions and 97 deletions

View File

@@ -74,6 +74,16 @@ function get_db_stat($mode)
return false;
}
// added at phpBB 2.0.11 to properly format the username
function phpbb_clean_username($username)
{
$username = htmlspecialchars(rtrim(trim($username), "\\"));
$username = substr(str_replace("\\'", "'", $username), 0, 25);
$username = str_replace("'", "\\'", $username);
return $username;
}
//
// Get Userdata, $user can be username or user_id. If force_str is true, the username will be forced.
//
@@ -83,9 +93,7 @@ function get_userdata($user, $force_str = false)
if (intval($user) == 0 || $force_str)
{
$user = trim(htmlspecialchars($user));
$user = substr(str_replace("\\'", "'", $user), 0, 25);
$user = str_replace("'", "\\'", $user);
$user = phpbb_clean_username($user);
}
else
{