Zeile 177 | Zeile 177 |
---|
{ error($lang->redirect_threadclosed); }
|
{ error($lang->redirect_threadclosed); }
|
}
// Is the currently logged in user a moderator of this forum? if(is_moderator($fid)) { $ismod = true; } else { $ismod = false;
| |
}
// No weird actions allowed, show new reply form if no regular action. if($mybb->input['action'] != "do_newreply" && $mybb->input['action'] != "editdraft")
|
}
// No weird actions allowed, show new reply form if no regular action. if($mybb->input['action'] != "do_newreply" && $mybb->input['action'] != "editdraft")
|
{ $mybb->input['action'] = "newreply"; }
| { $mybb->input['action'] = "newreply"; }
|
// Even if we are previewing, still show the new reply form. if(!empty($mybb->input['previewpost'])) {
| // Even if we are previewing, still show the new reply form. if(!empty($mybb->input['previewpost'])) {
|
Zeile 203 | Zeile 193 |
---|
// Setup a unique posthash for attachment management if(!$mybb->get_input('posthash') && !$pid)
|
// Setup a unique posthash for attachment management if(!$mybb->get_input('posthash') && !$pid)
|
{
| {
|
$mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].random_str());
|
$mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].random_str());
|
}
| }
|
if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == 1)
|
if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == 1)
|
{
| {
|
error($lang->error_cannot_upload_php_post); }
$errors = array(); $maximageserror = $attacherror = ''; if($mybb->settings['enableattachments'] == 1 && !$mybb->get_input('attachmentaid', MyBB::INPUT_INT) && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ($mybb->input['action'] == "do_newreply" && $mybb->get_input('submit') && $_FILES['attachment'])))
|
error($lang->error_cannot_upload_php_post); }
$errors = array(); $maximageserror = $attacherror = ''; if($mybb->settings['enableattachments'] == 1 && !$mybb->get_input('attachmentaid', MyBB::INPUT_INT) && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ($mybb->input['action'] == "do_newreply" && $mybb->get_input('submit') && $_FILES['attachment'])))
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
if($pid) {
| if($pid) {
|
Zeile 259 | Zeile 249 |
---|
if(!empty($attachedfile['error'])) { $errors[] = $attachedfile['error'];
|
if(!empty($attachedfile['error'])) { $errors[] = $attachedfile['error'];
|
$mybb->input['action'] = "newreply"; }
| $mybb->input['action'] = "newreply"; }
|
if(!$mybb->get_input('submit')) {
| if(!$mybb->get_input('submit')) {
|
Zeile 273 | Zeile 263 |
---|
if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && $mybb->get_input('attachmentact') == "remove") { // Verify incoming POST request
|
if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && $mybb->get_input('attachmentact') == "remove") { // Verify incoming POST request
|
verify_post_check($mybb->get_input('my_post_key'));
| verify_post_check($mybb->get_input('my_post_key'));
|
require_once MYBB_ROOT."inc/functions_upload.php"; remove_attachment($pid, $mybb->get_input('posthash'), $mybb->get_input('attachmentaid', MyBB::INPUT_INT));
| require_once MYBB_ROOT."inc/functions_upload.php"; remove_attachment($pid, $mybb->get_input('posthash'), $mybb->get_input('attachmentaid', MyBB::INPUT_INT));
|
Zeile 301 | Zeile 291 |
---|
}
if($mybb->input['action'] == "do_newreply" && $mybb->request_method == "post")
|
}
if($mybb->input['action'] == "do_newreply" && $mybb->request_method == "post")
|
{
| {
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
|
|
$plugins->run_hooks("newreply_do_newreply_start");
// If this isn't a logged in user, then we need to do some special validation. if($mybb->user['uid'] == 0) {
|
$plugins->run_hooks("newreply_do_newreply_start");
// If this isn't a logged in user, then we need to do some special validation. if($mybb->user['uid'] == 0) {
|
// Check if username exists. if(username_exists($mybb->get_input('username'))) { // If it does throw back "username is taken" error($lang->error_usernametaken);
| // If they didn't specify a username then give them "Guest" if(!$mybb->get_input('username')) { $username = $lang->guest;
|
}
|
}
|
// This username does not exist.
| // Otherwise use the name they specified.
|
else {
|
else {
|
// If they didn't specify a username then give them "Guest" if(!$mybb->get_input('username')) { $username = $lang->guest; } // Otherwise use the name they specified. else { $username = htmlspecialchars_uni($mybb->get_input('username')); } $uid = 0;
| $username = $mybb->get_input('username');
|
}
|
}
|
| $uid = 0;
|
if($mybb->settings['stopforumspam_on_newreply']) {
| if($mybb->settings['stopforumspam_on_newreply']) {
|
Zeile 613 | Zeile 594 |
---|
if($visible == 1) { // Set post counter
|
if($visible == 1) { // Set post counter
|
if($ismod == true)
| $postcounter = $thread['replies'] + 1;
if(is_moderator($fid, "canviewunapprove"))
|
{
|
{
|
$postcounter = $thread['replies'] + $thread['unapprovedposts'] + 1;
| $postcounter += $thread['unapprovedposts'];
|
}
|
}
|
else
| if(is_moderator($fid, "canviewdeleted"))
|
{
|
{
|
$postcounter = $thread['replies'] + 1;
| $postcounter += $thread['deletedposts'];
|
}
// Was there a new post since we hit the quick reply button?
| }
// Was there a new post since we hit the quick reply button?
|
Zeile 803 | Zeile 786 |
---|
if($quoted_post['tid'] == $tid || $load_all == 1) { // If this post was the post for which a quote button was clicked, set the subject
|
if($quoted_post['tid'] == $tid || $load_all == 1) { // If this post was the post for which a quote button was clicked, set the subject
|
if($pid == $quoted_post['pid'])
| if($replyto == $quoted_post['pid'])
|
{
|
{
|
$subject = preg_replace('#RE:\s?#i', '', $quoted_post['subject']);
| $subject = preg_replace('#^RE:\s?#i', '', $quoted_post['subject']);
|
// Subject too long? Shorten it to avoid error message if(my_strlen($subject) > 85) {
| // Subject too long? Shorten it to avoid error message if(my_strlen($subject) > 85) {
|
Zeile 873 | Zeile 856 |
---|
$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);
if(isset($postoptions['signature']) && $postoptions['signature'] == 1)
|
$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);
if(isset($postoptions['signature']) && $postoptions['signature'] == 1)
|
{ $postoptionschecked['signature'] = " checked=\"checked\""; } if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "none") { $postoptions_subscriptionmethod_none = "checked=\"checked\""; } else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "email") { $postoptions_subscriptionmethod_email = "checked=\"checked\""; } else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "pm") { $postoptions_subscriptionmethod_pm = "checked=\"checked\"";
| { $postoptionschecked['signature'] = " checked=\"checked\""; } if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "none") { $postoptions_subscriptionmethod_none = "checked=\"checked\""; } else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "email") { $postoptions_subscriptionmethod_email = "checked=\"checked\""; } else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "pm") { $postoptions_subscriptionmethod_pm = "checked=\"checked\"";
|
} else { $postoptions_subscriptionmethod_dont = "checked=\"checked\"";
|
} else { $postoptions_subscriptionmethod_dont = "checked=\"checked\"";
|
}
| }
|
if(isset($postoptions['disablesmilies']) && $postoptions['disablesmilies'] == 1) { $postoptionschecked['disablesmilies'] = " checked=\"checked\"";
| if(isset($postoptions['disablesmilies']) && $postoptions['disablesmilies'] == 1) { $postoptionschecked['disablesmilies'] = " checked=\"checked\"";
|
Zeile 899 | Zeile 882 |
---|
$subject = $mybb->input['subject']; } elseif($mybb->input['action'] == "editdraft" && $mybb->user['uid'])
|
$subject = $mybb->input['subject']; } elseif($mybb->input['action'] == "editdraft" && $mybb->user['uid'])
|
{
| {
|
$message = htmlspecialchars_uni($post['message']); $subject = $post['subject']; if($post['includesig'] != 0)
|
$message = htmlspecialchars_uni($post['message']); $subject = $post['subject']; if($post['includesig'] != 0)
|
{
| {
|
$postoptionschecked['signature'] = " checked=\"checked\""; } if($post['smilieoff'] == 1)
|
$postoptionschecked['signature'] = " checked=\"checked\""; } if($post['smilieoff'] == 1)
|
{
| {
|
$postoptionschecked['disablesmilies'] = " checked=\"checked\""; } if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "none")
|
$postoptionschecked['disablesmilies'] = " checked=\"checked\""; } if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "none")
|
{ $postoptions_subscriptionmethod_none = "checked=\"checked\""; }
| { $postoptions_subscriptionmethod_none = "checked=\"checked\""; }
|
else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "email")
|
else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "email")
|
{
| {
|
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
|
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
|
}
| }
|
else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "pm")
|
else if(isset($postoptions['subscriptionmethod']) && $postoptions['subscriptionmethod'] == "pm")
|
{ $postoptions_subscriptionmethod_pm = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; }
| { $postoptions_subscriptionmethod_pm = "checked=\"checked\""; } else { $postoptions_subscriptionmethod_dont = "checked=\"checked\""; }
|
$mybb->input['icon'] = $post['icon']; } else { if($mybb->user['signature'] != '')
|
$mybb->input['icon'] = $post['icon']; } else { if($mybb->user['signature'] != '')
|
{
| {
|
$postoptionschecked['signature'] = " checked=\"checked\""; } if($mybb->user['subscriptionmethod'] == 1) { $postoptions_subscriptionmethod_none = "checked=\"checked\"";
|
$postoptionschecked['signature'] = " checked=\"checked\""; } if($mybb->user['subscriptionmethod'] == 1) { $postoptions_subscriptionmethod_none = "checked=\"checked\"";
|
}
| }
|
else if($mybb->user['subscriptionmethod'] == 2)
|
else if($mybb->user['subscriptionmethod'] == 2)
|
{
| {
|
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
|
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
|
}
| }
|
else if($mybb->user['subscriptionmethod'] == 3) { $postoptions_subscriptionmethod_pm = "checked=\"checked\"";
|
else if($mybb->user['subscriptionmethod'] == 3) { $postoptions_subscriptionmethod_pm = "checked=\"checked\"";
|
}
| }
|
else { $postoptions_subscriptionmethod_dont = "checked=\"checked\"";
|
else { $postoptions_subscriptionmethod_dont = "checked=\"checked\"";
|
} }
| } }
|
if($forum['allowpicons'] != 0) {
| if($forum['allowpicons'] != 0) {
|
Zeile 963 | Zeile 946 |
---|
if(!empty($mybb->input['subject'])) { $subject = $mybb->get_input('subject');
|
if(!empty($mybb->input['subject'])) { $subject = $mybb->get_input('subject');
|
}
| }
|
else { $subject = $thread['subject'];
|
else { $subject = $thread['subject'];
|
| // Subject too long? Shorten it to avoid error message if(my_strlen($subject) > 85) { $subject = my_substr($subject, 0, 82).'...'; } $subject = "RE: ".$subject;
|
} }
| } }
|
Zeile 977 | Zeile 966 |
---|
// If this isn't a logged in user, then we need to do some special validation. if($mybb->user['uid'] == 0) {
|
// If this isn't a logged in user, then we need to do some special validation. if($mybb->user['uid'] == 0) {
|
// Check if username exists. if(username_exists($mybb->get_input('username'))) { // If it does throw back "username is taken" error($lang->error_usernametaken); } // This username does not exist.
| // If they didn't specify a username then give them "Guest" if(!$mybb->get_input('username')) { $username = $lang->guest; } // Otherwise use the name they specified.
|
else {
|
else {
|
// If they didn't specify a username then give them "Guest" if(!$mybb->get_input('username')) { $username = $lang->guest; } // Otherwise use the name they specified. else { $username = htmlspecialchars_uni($mybb->get_input('username')); } $uid = 0;
| $username = $mybb->get_input('username');
|
}
|
}
|
| $uid = 0;
|
} // This user is logged in. else
| } // This user is logged in. else
|
Zeile 1009 | Zeile 988 |
---|
// Set up posthandler. require_once MYBB_ROOT."inc/datahandlers/post.php"; $posthandler = new PostDataHandler("insert");
|
// Set up posthandler. require_once MYBB_ROOT."inc/datahandlers/post.php"; $posthandler = new PostDataHandler("insert");
|
| $posthandler->action = "post";
|
// Set the post data that came from the input to the $post array. $post = array(
| // Set the post data that came from the input to the $post array. $post = array(
|
Zeile 1121 | Zeile 1101 |
---|
}
$subject = htmlspecialchars_uni($parser->parse_badwords($subject));
|
}
$subject = htmlspecialchars_uni($parser->parse_badwords($subject));
|
if(!$pid && !isset($mybb->input['previewpost'])) { $subject = $thread['subject']; // Subject too long? Shorten it to avoid error message if(my_strlen($subject) > 85) { $subject = my_substr($subject, 0, 82).'...'; } $subject = "RE: ".$subject; }
| |
$posthash = htmlspecialchars_uni($mybb->get_input('posthash'));
| $posthash = htmlspecialchars_uni($mybb->get_input('posthash'));
|
Zeile 1252 | Zeile 1221 |
---|
{ $post_captcha->build_captcha(); }
|
{ $post_captcha->build_captcha(); }
|
elseif($post_captcha->type == 2)
| elseif($post_captcha->type == 2 || $post_captcha->type == 4)
|
{ $post_captcha->build_recaptcha(); }
| { $post_captcha->build_recaptcha(); }
|
Zeile 1266 | Zeile 1235 |
---|
$captcha = $post_captcha->html; } }
|
$captcha = $post_captcha->html; } }
|
else if($correct && $post_captcha->type == 2)
| else if($correct && ($post_captcha->type == 2 || $post_captcha->type == 4))
|
{ $post_captcha->build_recaptcha();
| { $post_captcha->build_recaptcha();
|