Vergleich newreply.php - 1.6.13 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 12Zeile 12
define("IN_MYBB", 1);
define('THIS_SCRIPT', 'newreply.php');


define("IN_MYBB", 1);
define('THIS_SCRIPT', 'newreply.php');


$templatelist = "newreply,previewpost,loginbox,changeuserbox,posticons,newreply_threadreview,newreply_threadreview_post,forumdisplay_rules,forumdisplay_rules_link,newreply_multiquote_external";

$templatelist = "newreply,previewpost,loginbox,changeuserbox,posticons,newreply_threadreview,newreply_threadreview_post,forumdisplay_rules,forumdisplay_rules_link,newreply_multiquote_external,post_attachments_add";

$templatelist .= ",smilieinsert,smilieinsert_getmore,codebuttons,post_attachments_new,post_attachments,post_savedraftbutton,newreply_modoptions,newreply_threadreview_more,newreply_disablesmilies,postbit_online,postbit_find,postbit_pm";
$templatelist .= ",postbit_www,postbit_email,postbit_reputation,postbit_warninglevel,postbit_author_user,postbit_edit,postbit_quickdelete,postbit_inlinecheck,postbit_posturl,postbit_quote,postbit_multiquote,postbit_report,postbit_ignored,postbit,post_subscription_method";
$templatelist .= ",post_attachments_attachment_postinsert,post_attachments_attachment_remove,post_attachments_attachment_unapproved,post_attachments_attachment,postbit_attachments_attachment,postbit_attachments,newreply_options_signature";

$templatelist .= ",smilieinsert,smilieinsert_getmore,codebuttons,post_attachments_new,post_attachments,post_savedraftbutton,newreply_modoptions,newreply_threadreview_more,newreply_disablesmilies,postbit_online,postbit_find,postbit_pm";
$templatelist .= ",postbit_www,postbit_email,postbit_reputation,postbit_warninglevel,postbit_author_user,postbit_edit,postbit_quickdelete,postbit_inlinecheck,postbit_posturl,postbit_quote,postbit_multiquote,postbit_report,postbit_ignored,postbit,post_subscription_method";
$templatelist .= ",post_attachments_attachment_postinsert,post_attachments_attachment_remove,post_attachments_attachment_unapproved,post_attachments_attachment,postbit_attachments_attachment,postbit_attachments,newreply_options_signature";

Zeile 286Zeile 286
		$lang->error_maxposts = $lang->sprintf($lang->error_maxposts, $mybb->settings['maxposts']);
error($lang->error_maxposts);
}

		$lang->error_maxposts = $lang->sprintf($lang->error_maxposts, $mybb->settings['maxposts']);
error($lang->error_maxposts);
}

 
}

// If this isn't a logged in user, then we need to do some special validation.
if($mybb->user['uid'] == 0)
{
$username = htmlspecialchars_uni($mybb->input['username']);

// Check if username exists.
if(username_exists($mybb->input['username']))
{
// If it does throw back "username is taken"
error($lang->error_usernametaken);
}
// This username does not exist.
else
{
// If they didn't specify a username then give them "Guest"
if(!$mybb->input['username'])
{
$username = $lang->guest;
}
// Otherwise use the name they specified.
else
{
$username = htmlspecialchars_uni($mybb->input['username']);
}
$uid = 0;
}
}
// This user is logged in.
else
{
$username = $mybb->user['username'];
$uid = $mybb->user['uid'];

}

if($mybb->input['action'] == "do_newreply" && $mybb->request_method == "post")

}

if($mybb->input['action'] == "do_newreply" && $mybb->request_method == "post")

Zeile 294Zeile 328
	verify_post_check($mybb->input['my_post_key']);

$plugins->run_hooks("newreply_do_newreply_start");

	verify_post_check($mybb->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)
{
$username = htmlspecialchars_uni($mybb->input['username']);

// Check if username exists.
if(username_exists($mybb->input['username']))
{
// If it does throw back "username is taken"
error($lang->error_usernametaken);
}
// This username does not exist.
else
{
// If they didn't specify a username then give them "Guest"
if(!$mybb->input['username'])
{
$username = $lang->guest;
}
// Otherwise use the name they specified.
else
{
$username = htmlspecialchars_uni($mybb->input['username']);
}
$uid = 0;
}
}
// This user is logged in.
else
{
$username = $mybb->user['username'];
$uid = $mybb->user['uid'];
}

 

// Attempt to see if this post is a duplicate or not
if($uid > 0)


// Attempt to see if this post is a duplicate or not
if($uid > 0)

	{

	{

		$user_check = "p.uid='{$uid}'";

		$user_check = "p.uid='{$uid}'";

	}

	}

	else

	else

	{

	{

		$user_check = "p.ipaddress='".$db->escape_string($session->ipaddress)."'";

		$user_check = "p.ipaddress='".$db->escape_string($session->ipaddress)."'";

	}
if(!$mybb->input['savedraft'])
{

	}
if(!$mybb->input['savedraft'])
{

		$query = $db->simple_select("posts p", "p.pid, p.visible", "{$user_check} AND p.tid='{$thread['tid']}' AND p.subject='".$db->escape_string($mybb->input['subject'])."' AND p.message='".$db->escape_string($mybb->input['message'])."' AND p.visible != '-2' AND p.dateline>".(TIME_NOW-600));
$duplicate_check = $db->fetch_field($query, "pid");
if($duplicate_check)

		$query = $db->simple_select("posts p", "p.pid, p.visible", "{$user_check} AND p.tid='{$thread['tid']}' AND p.subject='".$db->escape_string($mybb->input['subject'])."' AND p.message='".$db->escape_string($mybb->input['message'])."' AND p.visible != '-2' AND p.dateline>".(TIME_NOW-600));
$duplicate_check = $db->fetch_field($query, "pid");
if($duplicate_check)

Zeile 375Zeile 375
	if($mybb->input['savedraft'] && $mybb->user['uid'])
{
$post['savedraft'] = 1;

	if($mybb->input['savedraft'] && $mybb->user['uid'])
{
$post['savedraft'] = 1;

	}
else
{

	}
else
{

		$post['savedraft'] = 0;
}


		$post['savedraft'] = 0;
}


Zeile 387Zeile 387
		"subscriptionmethod" => $mybb->input['postoptions']['subscriptionmethod'],
"disablesmilies" => $mybb->input['postoptions']['disablesmilies']
);

		"subscriptionmethod" => $mybb->input['postoptions']['subscriptionmethod'],
"disablesmilies" => $mybb->input['postoptions']['disablesmilies']
);





	// Apply moderation options if we have them
$post['modoptions'] = $mybb->input['modoptions'];


	// Apply moderation options if we have them
$post['modoptions'] = $mybb->input['modoptions'];


Zeile 406Zeile 406
	// Mark thread as read
require_once MYBB_ROOT."inc/functions_indicators.php";
mark_thread_read($tid, $fid);

	// Mark thread as read
require_once MYBB_ROOT."inc/functions_indicators.php";
mark_thread_read($tid, $fid);





	// Check captcha image
if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
{

	// Check captcha image
if($mybb->settings['captchaimage'] && !$mybb->user['uid'])
{

Zeile 443Zeile 443

header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>$imagehash";


header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>$imagehash";





				if($hide_captcha)
{
echo "|$randomstr";

				if($hide_captcha)
{
echo "|$randomstr";

Zeile 452Zeile 452
				echo "</captcha>";
}
else if($post_captcha->type == 2)

				echo "</captcha>";
}
else if($post_captcha->type == 2)

			{

			{

				header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>reload</captcha>";
}

				header("Content-type: text/html; charset={$lang->settings['charset']}");
echo "<captcha>reload</captcha>";
}

Zeile 568Zeile 568
					{
redirect(get_thread_link($tid, 0, "lastpost"));
}

					{
redirect(get_thread_link($tid, 0, "lastpost"));
}

 
				}

if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)
{
$mybb->settings['postsperpage'] = 20;

				}

// Lets see if this post is on the same page as the one we're viewing or not

				}

// Lets see if this post is on the same page as the one we're viewing or not

Zeile 676Zeile 681
		if($replyto)
{
$quoted_posts[$replyto] = $replyto;

		if($replyto)
{
$quoted_posts[$replyto] = $replyto;

		}


		}


		// Quoting more than one post - fetch them
if(count($quoted_posts) > 0)
{

		// Quoting more than one post - fetch them
if(count($quoted_posts) > 0)
{

Zeile 821Zeile 826
			$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($postoptions['subscriptionmethod'] == "instant")

			$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($postoptions['subscriptionmethod'] == "instant")

		{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}

		{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}

		$mybb->input['icon'] = $post['icon'];
}
else

		$mybb->input['icon'] = $post['icon'];
}
else

Zeile 846Zeile 851
		else if($mybb->user['subscriptionmethod'] == 2)
{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";

		else if($mybb->user['subscriptionmethod'] == 2)
{
$postoptions_subscriptionmethod_instant = "checked=\"checked\"";

		}

		}

		else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

		else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";

Zeile 856Zeile 861
	if($forum['allowpicons'] != 0)
{
$posticons = get_post_icons();

	if($forum['allowpicons'] != 0)
{
$posticons = get_post_icons();

	}

	}


// No subject?
if(!isset($subject))


// No subject?
if(!isset($subject))

Zeile 864Zeile 869
		if($mybb->input['subject'])
{
$subject = $mybb->input['subject'];

		if($mybb->input['subject'])
{
$subject = $mybb->input['subject'];

		}
else

		}
else

		{
$subject = $thread['subject'];
}

		{
$subject = $thread['subject'];
}

Zeile 903Zeile 908
		// Now let the post handler do all the hard work.
$valid_post = $posthandler->verify_message();
$valid_subject = $posthandler->verify_subject();

		// Now let the post handler do all the hard work.
$valid_post = $posthandler->verify_message();
$valid_subject = $posthandler->verify_subject();

 
		
// guest post --> verify author
if($post['uid'] == 0)
{
$valid_username = $posthandler->verify_author();
}
else
{
$valid_username = true;
}


$post_errors = array();
// Fetch friendly error messages if this is an invalid post


$post_errors = array();
// Fetch friendly error messages if this is an invalid post

		if(!$valid_post || !$valid_subject)

		if(!$valid_post || !$valid_subject || !$valid_username)

		{
$post_errors = $posthandler->get_friendly_errors();
}

		{
$post_errors = $posthandler->get_friendly_errors();
}

Zeile 1054Zeile 1069

if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)
{


if($mybb->settings['maxattachments'] == 0 || ($mybb->settings['maxattachments'] != 0 && $attachcount < $mybb->settings['maxattachments']) && !$noshowattach)
{

 
			eval("\$attach_add_options = \"".$templates->get("post_attachments_add")."\";");

			eval("\$newattach = \"".$templates->get("post_attachments_new")."\";");
}


			eval("\$newattach = \"".$templates->get("post_attachments_new")."\";");
}


Zeile 1116Zeile 1132

if($mybb->settings['threadreview'] != 0)
{


if($mybb->settings['threadreview'] != 0)
{

		if(!$mybb->settings['postsperpage'])

		if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['postsperpage'] < 1)

		{

		{

			$mybb->settings['postperpage'] = 20;

			$mybb->settings['postsperpage'] = 20;

		}

if(is_moderator($fid))

		}

if(is_moderator($fid))