mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Flood control, error reporting fixed
git-svn-id: file:///svn/phpbb/trunk@715 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5a1d4660ba
commit
011d6d99ee
1 changed files with 29 additions and 8 deletions
|
@ -51,12 +51,13 @@ else
|
||||||
}
|
}
|
||||||
$start = (!empty($HTTP_GET_VARS['start'])) ? $HTTP_GET_VARS['start'] : 0;
|
$start = (!empty($HTTP_GET_VARS['start'])) ? $HTTP_GET_VARS['start'] : 0;
|
||||||
|
|
||||||
|
$error = FALSE;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Start main
|
// Start main
|
||||||
//
|
//
|
||||||
if($mode == "read")
|
if($mode == "read")
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!empty($HTTP_GET_VARS[POST_POST_URL]))
|
if(!empty($HTTP_GET_VARS[POST_POST_URL]))
|
||||||
{
|
{
|
||||||
$privmsgs_id = $HTTP_GET_VARS[POST_POST_URL];
|
$privmsgs_id = $HTTP_GET_VARS[POST_POST_URL];
|
||||||
|
@ -564,7 +565,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||||
$error_msg .= $lang['Empty_subject'];
|
$error_msg .= $lang['Empty_subject'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($message))
|
if( !empty($message) )
|
||||||
{
|
{
|
||||||
if(!$error && !$preview)
|
if(!$error && !$preview)
|
||||||
{
|
{
|
||||||
|
@ -583,12 +584,15 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if(!$error)
|
||||||
{
|
{
|
||||||
// do stripslashes incase magic_quotes is on.
|
// do stripslashes incase magic_quotes is on.
|
||||||
$message = stripslashes($HTTP_POST_VARS['message']);
|
$message = stripslashes($HTTP_POST_VARS['message']);
|
||||||
$message = preg_replace('#</textarea>#si', '</TEXTAREA>', $message);
|
$message = preg_replace('#</textarea>#si', '</TEXTAREA>', $message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$error = TRUE;
|
$error = TRUE;
|
||||||
|
@ -599,7 +603,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||||
$error_msg .= $lang['Empty_msg'];
|
$error_msg .= $lang['Empty_msg'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($to_username))
|
if( !empty($to_username) )
|
||||||
{
|
{
|
||||||
$sql = "SELECT user_id, username, user_notify_pm, user_email
|
$sql = "SELECT user_id, username, user_notify_pm, user_email
|
||||||
FROM " . USERS_TABLE . "
|
FROM " . USERS_TABLE . "
|
||||||
|
@ -625,9 +629,9 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||||
$error_msg .= $lang['No_to_user'];
|
$error_msg .= $lang['No_to_user'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$preview)
|
if(!$preview && !$error)
|
||||||
{
|
{
|
||||||
$msg_time = get_gmt_ts();
|
$msg_time = time();
|
||||||
|
|
||||||
if($mode != "edit")
|
if($mode != "edit")
|
||||||
{
|
{
|
||||||
|
@ -744,6 +748,23 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||||
$template->pparse("preview");
|
$template->pparse("preview");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Start error handling
|
||||||
|
//
|
||||||
|
if($error)
|
||||||
|
{
|
||||||
|
$template->set_filenames(array(
|
||||||
|
"reg_header" => "error_body.tpl")
|
||||||
|
);
|
||||||
|
$template->assign_vars(array(
|
||||||
|
"ERROR_MESSAGE" => $error_msg)
|
||||||
|
);
|
||||||
|
$template->pparse("reg_header");
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// End error handling
|
||||||
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
// Load templates
|
// Load templates
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Reference in a new issue