mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Fixed a problem with newlines replacing breaks in sigs
git-svn-id: file:///svn/phpbb/trunk@333 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e1139ff198
commit
81c26eef7e
1 changed files with 49 additions and 13 deletions
|
@ -42,10 +42,44 @@ function validate_username($username)
|
||||||
|
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$sql = "SELECT u.username, d.disallow_username
|
switch(SQL_LAYER)
|
||||||
FROM ".USERS_TABLE." u, ".DISALLOW_TABLE." d
|
{
|
||||||
WHERE LOWER(u.username) = '".strtolower($username)."'
|
// Along with subqueries MySQL also lacks
|
||||||
OR d.disallow_username = '$username'";
|
// a UNION clause which would be very nice here :(
|
||||||
|
// So we have to use two queries
|
||||||
|
case 'mysql':
|
||||||
|
$sql_users = "SELECT username
|
||||||
|
FROM ".USERS_TABLE."
|
||||||
|
WHERE LOWER(u.username) = '".strtolower($username)."'";
|
||||||
|
$sql_disallow = "SELECT disallow_username
|
||||||
|
FROM ".DISALLOW_TABLE."
|
||||||
|
WHERE disallow_username = '$username'";
|
||||||
|
|
||||||
|
if($result = $db->sql_query($sql_users))
|
||||||
|
{
|
||||||
|
if($db->sql_numrows($result) > 0)
|
||||||
|
{
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if($result = $db->sql_query($sql_disallow))
|
||||||
|
{
|
||||||
|
if($db->sql_numrows($result) > 0)
|
||||||
|
{
|
||||||
|
return(FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
$sql = "SELECT disallow_username
|
||||||
|
FROM ".DISALLOW_TABLE."
|
||||||
|
WHERE disallow_username = '$username'
|
||||||
|
UNION
|
||||||
|
SELECT username
|
||||||
|
FROM ".USERS_TABLE."
|
||||||
|
WHERE LOWER(username) = '".strtolower($username)."'";
|
||||||
|
|
||||||
if($result = $db->sql_query($sql))
|
if($result = $db->sql_query($sql))
|
||||||
{
|
{
|
||||||
if($db->sql_numrows($result) > 0)
|
if($db->sql_numrows($result) > 0)
|
||||||
|
@ -53,6 +87,8 @@ function validate_username($username)
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
@ -116,7 +152,7 @@ function theme_select($default)
|
||||||
{
|
{
|
||||||
if(stripslashes($rowset[$i]['themes_name']) == $default || $rowset[$i]['themes_id'] == $default)
|
if(stripslashes($rowset[$i]['themes_name']) == $default || $rowset[$i]['themes_id'] == $default)
|
||||||
{
|
{
|
||||||
$selected = " SELECTED";
|
$selected = " selected";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -177,7 +213,7 @@ function tz_select($default)
|
||||||
{
|
{
|
||||||
if($offset == $default)
|
if($offset == $default)
|
||||||
{
|
{
|
||||||
$selected = " SELECTED";
|
$selected = " selected";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -342,7 +378,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
|
||||||
$location = (!empty($HTTP_POST_VARS['location'])) ? trim(strip_tags(addslashes($HTTP_POST_VARS['location']))) : "";
|
$location = (!empty($HTTP_POST_VARS['location'])) ? trim(strip_tags(addslashes($HTTP_POST_VARS['location']))) : "";
|
||||||
$occupation = (!empty($HTTP_POST_VARS['occupation'])) ? trim(strip_tags(addslashes($HTTP_POST_VARS['occupation']))) : "";
|
$occupation = (!empty($HTTP_POST_VARS['occupation'])) ? trim(strip_tags(addslashes($HTTP_POST_VARS['occupation']))) : "";
|
||||||
$interests = (!empty($HTTP_POST_VARS['interests'])) ? trim(addslashes($HTTP_POST_VARS['interests'])) : "";
|
$interests = (!empty($HTTP_POST_VARS['interests'])) ? trim(addslashes($HTTP_POST_VARS['interests'])) : "";
|
||||||
$signature = (!empty($HTTP_POST_VARS['signature'])) ? trim(addslashes(str_replace("\n", "<br />", $HTTP_POST_VARS['signature']))) : "";
|
echo $signature = (!empty($HTTP_POST_VARS['signature'])) ? trim(addslashes(str_replace("<br />", "\n", $HTTP_POST_VARS['signature']))) : "";
|
||||||
|
|
||||||
$viewemail = $HTTP_POST_VARS['viewemail'];
|
$viewemail = $HTTP_POST_VARS['viewemail'];
|
||||||
$attachsig = $HTTP_POST_VARS['attachsig'];
|
$attachsig = $HTTP_POST_VARS['attachsig'];
|
||||||
|
|
Loading…
Add table
Reference in a new issue