phpbb에서 로그인에러 메시지가 나올때
login.php에 이 함수를 추가시켜주면 로그인에러가 사라집니다.
function phpbb_clean_username($username)
{
$username = substr(htmlspecialchars(str_replace("'", "'", trim($username))), 0, 25);
$username = phpbb_rtrim($username, "");
$username = str_replace("'", "'", $username);
return $username;
}
// added at phpBB 2.0.12 to fix a bug in PHP 4.3.10 (only supporting charlist in php >= 4.1.0)
function phpbb_rtrim($str, $charlist = false)
{
if ($charlist === false)
{
return rtrim($str);
}
$php_version = explode('.', PHP_VERSION);
// php version < 4.1.0
if ((int) $php_version[0] < 4 || ((int) $php_version[0] == 4 && (int) $php_version[1] < 1))
{
while ($str{strlen($str)-1} == $charlist)
{
$str = substr($str, 0, strlen($str)-1);
}
}
else
{
$str = rtrim($str, $charlist);
}
return $str;
}
login.php에 이 함수를 추가시켜주면 로그인에러가 사라집니다.
function phpbb_clean_username($username)
{
$username = substr(htmlspecialchars(str_replace("'", "'", trim($username))), 0, 25);
$username = phpbb_rtrim($username, "");
$username = str_replace("'", "'", $username);
return $username;
}
// added at phpBB 2.0.12 to fix a bug in PHP 4.3.10 (only supporting charlist in php >= 4.1.0)
function phpbb_rtrim($str, $charlist = false)
{
if ($charlist === false)
{
return rtrim($str);
}
$php_version = explode('.', PHP_VERSION);
// php version < 4.1.0
if ((int) $php_version[0] < 4 || ((int) $php_version[0] == 4 && (int) $php_version[1] < 1))
{
while ($str{strlen($str)-1} == $charlist)
{
$str = substr($str, 0, strlen($str)-1);
}
}
else
{
$str = rtrim($str, $charlist);
}
return $str;
}
--------------------------------------------------광고(Advertising)-------------------------------------------------------------------------------------