Vergleich editpost.php - 1.8.1 - 1.8.5

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


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


$templatelist = "editpost,previewpost,changeuserbox,codebuttons,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,post_attachments_attachment_postinsert,post_attachments_attachment_mod_unapprove";
$templatelist .= ",editpost_delete,error_attacherror,forumdisplay_password_wrongpass,forumdisplay_password,editpost_reason,post_attachments_attachment_remove,post_attachments_update,postbit_author_guest,post_subscription_method";
$templatelist .= ",posticons_icon,post_prefixselect_prefix,post_prefixselect_single,newthread_postpoll,editpost_disablesmilies,post_attachments_attachment_mod_approve,post_attachments_attachment_unapproved,post_attachments_new";



$templatelist = "editpost,previewpost,changeuserbox,codebuttons,smilieinsert,smilieinsert_getmore,smilieinsert_smilie,smilieinsert_smilie_empty,post_attachments_attachment_postinsert,post_attachments_attachment_mod_unapprove,postbit_attachments_thumbnails";
$templatelist .= ",editpost_delete,error_attacherror,forumdisplay_password_wrongpass,forumdisplay_password,editpost_reason,post_attachments_attachment_remove,post_attachments_update,post_subscription_method,postbit_online,postbit_away";
$templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,postbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,postbit_author_user,postbit_icon,postbit_userstar,postbit_offline,postbit_attachments_images";
$templatelist .= ",postbit_signature,postbit_classic,postbit,postbit_attachments_thumbnails_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,postbit_attachments_attachment_unapproved,post_attachments_update,postbit_attachments";
$templatelist .= ",posticons_icon,post_prefixselect_prefix,post_prefixselect_single,newthread_postpoll,editpost_disablesmilies,post_attachments_attachment_mod_approve,post_attachments_attachment_unapproved,post_attachments_new,postbit_gotopost";

$templatelist .= ",postbit_warninglevel_formatted,postbit_reputation_formatted_link,editpost_disablesmilies_hidden,attachment_icon,post_attachments_attachment,post_attachments_add,post_attachments,posticons,global_moderation_notice";

require_once "./global.php";

$templatelist .= ",postbit_warninglevel_formatted,postbit_reputation_formatted_link,editpost_disablesmilies_hidden,attachment_icon,post_attachments_attachment,post_attachments_add,post_attachments,posticons,global_moderation_notice";

require_once "./global.php";

Zeile 32Zeile 34
}

// Get post info

}

// Get post info

$pid = $mybb->get_input('pid', 1);

$pid = $mybb->get_input('pid', MyBB::INPUT_INT);


// if we already have the post information...
if(isset($style) && $style['pid'] == $pid && $style['type'] != 'f')


// if we already have the post information...
if(isset($style) && $style['pid'] == $pid && $style['type'] != 'f')

Zeile 112Zeile 114

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


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

	if(!is_moderator($fid, "candeleteposts"))

	if(!is_moderator($fid, "candeleteposts") && !is_moderator($fid, "cansoftdeleteposts") && $pid != $thread['firstpost'] || !is_moderator($fid, "candeletethreads") && !is_moderator($fid, "cansoftdeletethreads") && $pid == $thread['firstpost'])

	{
if($thread['closed'] == 1)
{
error($lang->redirect_threadclosed);
}

	{
if($thread['closed'] == 1)
{
error($lang->redirect_threadclosed);
}

		if($forumpermissions['candeleteposts'] == 0)

		if($forumpermissions['candeleteposts'] == 0 && $pid != $thread['firstpost'] || $forumpermissions['candeletethreads'] == 0 && $pid == $thread['firstpost'])

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 139Zeile 141
}
elseif($mybb->input['action'] == "restorepost" && $mybb->request_method == "post")
{

}
elseif($mybb->input['action'] == "restorepost" && $mybb->request_method == "post")
{

	if(!is_moderator($fid) || $post['visible'] != -1 || $mybb->settings['soft_delete'] == 0)

	if(!is_moderator($fid, "canrestoreposts") && $pid != $thread['firstpost'] || !is_moderator($fid, "canrestorethreads") && $pid == $thread['firstpost'] || $post['visible'] != -1)

	{
error_no_permission();
}

	{
error_no_permission();
}

Zeile 178Zeile 180
// Check if this forum is password protected and we have a valid password
check_forum_password($forum['fid']);


// Check if this forum is password protected and we have a valid password
check_forum_password($forum['fid']);


if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', 1) == '1')

if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == '1')

{
error($lang->error_cannot_upload_php_post);
}

$attacherror = '';

{
error($lang->error_cannot_upload_php_post);
}

$attacherror = '';

if($mybb->settings['enableattachments'] == 1 && !$mybb->get_input('attachmentaid', 1) && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ($mybb->input['action'] == "do_editpost" && isset($mybb->input['submit']) && $_FILES['attachment'])))

if($mybb->settings['enableattachments'] == 1 && !$mybb->get_input('attachmentaid', MyBB::INPUT_INT) && ($mybb->get_input('newattachment') || $mybb->get_input('updateattachment') || ($mybb->input['action'] == "do_editpost" && isset($mybb->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'));

Zeile 213Zeile 215
	}
}


	}
}


if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', 1) && isset($mybb->input['attachmentact']) && $mybb->input['action'] == "do_editpost" && $mybb->request_method == "post") // Lets remove/approve/unapprove the attachment

if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid', MyBB::INPUT_INT) && isset($mybb->input['attachmentact']) && $mybb->input['action'] == "do_editpost" && $mybb->request_method == "post") // Lets remove/approve/unapprove the 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'));


	$mybb->input['attachmentaid'] = $mybb->get_input('attachmentaid', 1);

	$mybb->input['attachmentaid'] = $mybb->get_input('attachmentaid', MyBB::INPUT_INT);

	if($mybb->input['attachmentact'] == "remove")
{
remove_attachment($pid, "", $mybb->input['attachmentaid']);

	if($mybb->input['attachmentact'] == "remove")
{
remove_attachment($pid, "", $mybb->input['attachmentaid']);

Zeile 248Zeile 250

$plugins->run_hooks("editpost_deletepost");



$plugins->run_hooks("editpost_deletepost");


	if($mybb->get_input('delete', 1) == 1)

	if($mybb->get_input('delete', MyBB::INPUT_INT) == 1)

	{
$query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "asc"));
$firstcheck = $db->fetch_array($query);

	{
$query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "asc"));
$firstcheck = $db->fetch_array($query);

Zeile 265Zeile 267
		$modlogdata['tid'] = $tid;
if($firstpost)
{

		$modlogdata['tid'] = $tid;
if($firstpost)
{

			if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads"))

			if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads"))

			{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;


			{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;


				if($mybb->settings['soft_delete'] == 1)

				if($mybb->settings['soft_delete'] == 1 || is_moderator($fid, "cansoftdeletethreads"))

				{
$modlogdata['pid'] = $pid;


				{
$modlogdata['pid'] = $pid;


Zeile 283Zeile 285
					mark_reports($tid, "thread");
log_moderator_action($modlogdata, $lang->thread_deleted);
}

					mark_reports($tid, "thread");
log_moderator_action($modlogdata, $lang->thread_deleted);
}

				



				if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");

				if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");

					if($mybb->settings['soft_delete'] == 1 && is_moderator($fid))

					if(is_moderator($fid, "canviewdeleted"))

					{
echo json_encode(array("data" => '1'));
}

					{
echo json_encode(array("data" => '1'));
}

Zeile 295Zeile 297
					{
echo json_encode(array("data" => '3', "url" => get_forum_link($fid)));
}

					{
echo json_encode(array("data" => '3', "url" => get_forum_link($fid)));
}

				}

				}

				else
{
redirect(get_forum_link($fid), $lang->redirect_threaddeleted);

				else
{
redirect(get_forum_link($fid), $lang->redirect_threaddeleted);

				}
}

				}
}

			else
{
error_no_permission();

			else
{
error_no_permission();

Zeile 308Zeile 310
		}
else
{

		}
else
{

			if($forumpermissions['candeleteposts'] == 1 || is_moderator($fid, "candeleteposts"))

			if($forumpermissions['candeleteposts'] == 1 || is_moderator($fid, "candeleteposts") || is_moderator($fid, "cansoftdeleteposts"))

			{
// Select the first post before this
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;


			{
// Select the first post before this
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;


				if($mybb->settings['soft_delete'] == 1)

				if($mybb->settings['soft_delete'] == 1 || is_moderator($fid, "cansoftdeleteposts"))

				{
$modlogdata['pid'] = $pid;


				{
$modlogdata['pid'] = $pid;


Zeile 333Zeile 335
				if($next_post['pid'])
{
$redirect = get_post_link($next_post['pid'], $tid)."#pid{$next_post['pid']}";

				if($next_post['pid'])
{
$redirect = get_post_link($next_post['pid'], $tid)."#pid{$next_post['pid']}";

				}
else

				}
else

				{
$redirect = get_thread_link($tid);
}

				{
$redirect = get_thread_link($tid);
}

				



				if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");

				if($mybb->input['ajax'] == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");

					if($mybb->settings['soft_delete'] == 1 && is_moderator($fid))

					if(is_moderator($fid, "canviewdeleted"))

					{
echo json_encode(array("data" => '1'));
}

					{
echo json_encode(array("data" => '1'));
}

Zeile 350Zeile 352
					{
echo json_encode(array("data" => '2'));
}

					{
echo json_encode(array("data" => '2'));
}

				}
else
{

				}
else
{

					redirect($redirect, $lang->redirect_postdeleted);
}
}

					redirect($redirect, $lang->redirect_postdeleted);
}
}

Zeile 375Zeile 377

$plugins->run_hooks("editpost_restorepost");



$plugins->run_hooks("editpost_restorepost");


	if($mybb->get_input('restore', 1) == 1)

	if($mybb->get_input('restore', MyBB::INPUT_INT) == 1)

	{
$query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "asc"));
$firstcheck = $db->fetch_array($query);

	{
$query = $db->simple_select("posts", "pid", "tid='{$tid}'", array("limit" => 1, "order_by" => "dateline", "order_dir" => "asc"));
$firstcheck = $db->fetch_array($query);

Zeile 393Zeile 395
		$modlogdata['pid'] = $pid;
if($firstpost)
{

		$modlogdata['pid'] = $pid;
if($firstpost)
{

			if(is_moderator($fid))

			if(is_moderator($fid, "canrestorethreads"))

			{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;

			{
require_once MYBB_ROOT."inc/class_moderation.php";
$moderation = new Moderation;

Zeile 416Zeile 418
		}
else
{

		}
else
{

			if(is_moderator($fid))

			if(is_moderator($fid, "canrestoreposts"))

			{
// Select the first post before this
require_once MYBB_ROOT."inc/class_moderation.php";

			{
// Select the first post before this
require_once MYBB_ROOT."inc/class_moderation.php";

Zeile 462Zeile 464
	// Set the post data that came from the input to the $post array.
$post = array(
"pid" => $mybb->input['pid'],

	// Set the post data that came from the input to the $post array.
$post = array(
"pid" => $mybb->input['pid'],

		"prefix" => $mybb->get_input('threadprefix', 1),

		"prefix" => $mybb->get_input('threadprefix', MyBB::INPUT_INT),

		"subject" => $mybb->get_input('subject'),

		"subject" => $mybb->get_input('subject'),

		"icon" => $mybb->get_input('icon', 1),

		"icon" => $mybb->get_input('icon', MyBB::INPUT_INT),

		"uid" => $post['uid'],
"username" => $post['username'],
"edit_uid" => $mybb->user['uid'],

		"uid" => $post['uid'],
"username" => $post['username'],
"edit_uid" => $mybb->user['uid'],

Zeile 472Zeile 474
		"editreason" => $mybb->get_input('editreason'),
);


		"editreason" => $mybb->get_input('editreason'),
);


	$postoptions = $mybb->get_input('postoptions', 2);

	$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);

	if(!isset($postoptions['signature']))
{
$postoptions['signature'] = 0;

	if(!isset($postoptions['signature']))
{
$postoptions['signature'] = 0;

Zeile 513Zeile 515
		$db->delete_query("attachments", "filename='' OR filesize<1");

// Did the user choose to post a poll? Redirect them to the poll posting page.

		$db->delete_query("attachments", "filename='' OR filesize<1");

// Did the user choose to post a poll? Redirect them to the poll posting page.

		if($mybb->get_input('postpoll', 1) && $forumpermissions['canpostpolls'])

		if($mybb->get_input('postpoll', MyBB::INPUT_INT) && $forumpermissions['canpostpolls'])

		{

		{

			$url = "polls.php?action=newpoll&tid=$tid&polloptions=".$mybb->get_input('numpolloptions', 1);

			$url = "polls.php?action=newpoll&tid=$tid&polloptions=".$mybb->get_input('numpolloptions', MyBB::INPUT_INT);

			$lang->redirect_postedited = $lang->redirect_postedited_poll;
}
else if($visible == 0 && $first_post && !is_moderator($fid, "canviewunapprove", $mybb->user['uid']))

			$lang->redirect_postedited = $lang->redirect_postedited_poll;
}
else if($visible == 0 && $first_post && !is_moderator($fid, "canviewunapprove", $mybb->user['uid']))

Zeile 643Zeile 645
		}
eval("\$attachbox = \"".$templates->get("post_attachments")."\";");
}

		}
eval("\$attachbox = \"".$templates->get("post_attachments")."\";");
}

	if(!$mybb->get_input('attachmentaid', 1) && !$mybb->get_input('newattachment') && !$mybb->get_input('updateattachment') && !isset($mybb->input['previewpost']))

	if(!$mybb->get_input('attachmentaid', MyBB::INPUT_INT) && !$mybb->get_input('newattachment') && !$mybb->get_input('updateattachment') && !isset($mybb->input['previewpost']))

	{
$message = $post['message'];
$subject = $post['subject'];

	{
$message = $post['message'];
$subject = $post['subject'];

Zeile 674Zeile 676
		// Set the post data that came from the input to the $post array.
$post = array(
"pid" => $mybb->input['pid'],

		// Set the post data that came from the input to the $post array.
$post = array(
"pid" => $mybb->input['pid'],

			"prefix" => $mybb->get_input('threadprefix', 1),

			"prefix" => $mybb->get_input('threadprefix', MyBB::INPUT_INT),

			"subject" => $mybb->get_input('subject'),

			"subject" => $mybb->get_input('subject'),

			"icon" => $mybb->get_input('icon', 1),

			"icon" => $mybb->get_input('icon', MyBB::INPUT_INT),

			"uid" => $post['uid'],
"edit_uid" => $mybb->user['uid'],
"message" => $mybb->get_input('message'),
);


			"uid" => $post['uid'],
"edit_uid" => $mybb->user['uid'],
"message" => $mybb->get_input('message'),
);


		$postoptions = $mybb->get_input('postoptions', 2);

		$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);

		if(!isset($postoptions['signature']))
{
$postoptions['signature'] = 0;

		if(!isset($postoptions['signature']))
{
$postoptions['signature'] = 0;

Zeile 720Zeile 722
			$message = htmlspecialchars_uni($message);
$subject = htmlspecialchars_uni($subject);


			$message = htmlspecialchars_uni($message);
$subject = htmlspecialchars_uni($subject);


			$postoptions = $mybb->get_input('postoptions', 2);

			$postoptions = $mybb->get_input('postoptions', MyBB::INPUT_ARRAY);


if(isset($postoptions['signature']) && $postoptions['signature'] == 1)
{


if(isset($postoptions['signature']) && $postoptions['signature'] == 1)
{

Zeile 837Zeile 839
	// Generate thread prefix selector if this is the first post of the thread
if($thread['firstpost'] == $pid)
{

	// Generate thread prefix selector if this is the first post of the thread
if($thread['firstpost'] == $pid)
{

		if(!$mybb->get_input('threadprefix', 1))

		if(!$mybb->get_input('threadprefix', MyBB::INPUT_INT))

		{
$mybb->input['threadprefix'] = $thread['prefix'];
}


		{
$mybb->input['threadprefix'] = $thread['prefix'];
}


		$prefixselect = build_prefix_select($forum['fid'], $mybb->get_input('threadprefix', 1));

		$prefixselect = build_prefix_select($forum['fid'], $mybb->get_input('threadprefix', MyBB::INPUT_INT));

	}
else
{

	}
else
{