Vergleich editpost.php - 1.8.19 - 1.8.21

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 71Zeile 71

if($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove") || $thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted") || ($thread['visible'] < -1 && $thread['uid'] != $mybb->user['uid']))
{


if($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove") || $thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted") || ($thread['visible'] < -1 && $thread['uid'] != $mybb->user['uid']))
{

	error($lang->error_invalidthread);




	if($thread['visible'] == 0 && !($mybb->settings['showownunapproved'] && $thread['uid'] == $mybb->user['uid']))
{
error($lang->error_invalidthread);
}

}
if(!$forum || $forum['type'] != "f")
{

}
if(!$forum || $forum['type'] != "f")
{

Zeile 105Zeile 108
	$codebuttons = build_mycode_inserter("message", $mybb->settings['smilieinserter']);
}
if($mybb->settings['smilieinserter'] != 0)

	$codebuttons = build_mycode_inserter("message", $mybb->settings['smilieinserter']);
}
if($mybb->settings['smilieinserter'] != 0)

{

{

	$smilieinserter = build_clickable_smilies();

	$smilieinserter = build_clickable_smilies();

}


}


$mybb->input['action'] = $mybb->get_input('action');
if(!$mybb->input['action'] || isset($mybb->input['previewpost']))
{

$mybb->input['action'] = $mybb->get_input('action');
if(!$mybb->input['action'] || isset($mybb->input['previewpost']))
{

Zeile 116Zeile 119
}

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

}

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

{

{

	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)

	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);

			error($lang->redirect_threadclosed);

		}

		}

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

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

			error_no_permission();
}
if($mybb->user['uid'] != $post['uid'])
{
error_no_permission();
}
// User can't delete unapproved post
if($post['visible'] == 0)
{

			error_no_permission();
}
if($mybb->user['uid'] != $post['uid'])
{
error_no_permission();
}
// User can't delete unapproved post unless allowed for own
if($post['visible'] == 0 && !($mybb->settings['showownunapproved'] && $post['uid'] == $mybb->user['uid']))
{

			error_no_permission();
}
}
if($post['visible'] == -1 && $mybb->settings['soft_delete'] == 1)
{
error($lang->error_already_deleted);

			error_no_permission();
}
}
if($post['visible'] == -1 && $mybb->settings['soft_delete'] == 1)
{
error($lang->error_already_deleted);

	}
}

	}
}

elseif($mybb->input['action'] == "restorepost" && $mybb->request_method == "post")
{
if(!is_moderator($fid, "canrestoreposts") && $pid != $thread['firstpost'] || !is_moderator($fid, "canrestorethreads") && $pid == $thread['firstpost'] || $post['visible'] != -1)

elseif($mybb->input['action'] == "restorepost" && $mybb->request_method == "post")
{
if(!is_moderator($fid, "canrestoreposts") && $pid != $thread['firstpost'] || !is_moderator($fid, "canrestorethreads") && $pid == $thread['firstpost'] || $post['visible'] != -1)

Zeile 162Zeile 165
			error_no_permission();
}
if($mybb->user['uid'] != $post['uid'])

			error_no_permission();
}
if($mybb->user['uid'] != $post['uid'])

		{
error_no_permission();

		{
error_no_permission();

		}
// Edit time limit
$time = TIME_NOW;

		}
// Edit time limit
$time = TIME_NOW;

Zeile 173Zeile 176
			error($lang->edit_time_limit);
}
// User can't edit unapproved post

			error($lang->edit_time_limit);
}
// User can't edit unapproved post

		if($post['visible'] == 0 || $post['visible'] == -1)

		if(($post['visible'] == 0 && !($mybb->settings['showownunapproved'] && $post['uid'] == $mybb->user['uid'])) || $post['visible'] == -1)

		{
error_no_permission();
}

		{
error_no_permission();
}

Zeile 186Zeile 189
if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPUT_INT) == '1')
{
error($lang->error_empty_post_input);

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

}


}


$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_editpost" && isset($mybb->input['submit']) && $_FILES['attachment'])))
{

$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_editpost" && isset($mybb->input['submit']) && $_FILES['attachment'])))
{

Zeile 197Zeile 200
	if($pid)
{
$attachwhere = "pid='{$pid}'";

	if($pid)
{
$attachwhere = "pid='{$pid}'";

	}
else

	}
else

	{
$attachwhere = "posthash='".$db->escape_string($mybb->get_input('posthash'))."'";
}

	{
$attachwhere = "posthash='".$db->escape_string($mybb->get_input('posthash'))."'";
}

Zeile 208Zeile 211
	if(!empty($ret['errors']))
{
$errors = $ret['errors'];

	if(!empty($ret['errors']))
{
$errors = $ret['errors'];

	}


	}


	// Do we have attachment errors?
if(!empty($errors))

	// Do we have attachment errors?
if(!empty($errors))

	{

	{

		$attacherror = inline_error($errors);

		$attacherror = inline_error($errors);

	}

	}


// If we were dealing with an attachment but didn't click 'Update Post', force the post edit page again.


// If we were dealing with an attachment but didn't click 'Update Post', force the post edit page again.

	if(!isset($mybb->input['submit']))
{
$mybb->input['action'] = "editpost";
}

	if(!isset($mybb->input['submit']))
{
$mybb->input['action'] = "editpost";
}

}

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

}

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

Zeile 245Zeile 248
		$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");
update_thread_counters($post['tid'], array('attachmentcount' => "-1"));
}

		$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");
update_thread_counters($post['tid'], array('attachmentcount' => "-1"));
}

 

if($mybb->get_input('ajax', MyBB::INPUT_INT) == 1)
{
header("Content-type: application/json; charset={$lang->settings['charset']}");
echo json_encode(array("success" => true));
exit();
}


	if(!isset($mybb->input['submit']))
{
$mybb->input['action'] = "editpost";

	if(!isset($mybb->input['submit']))
{
$mybb->input['action'] = "editpost";

Zeile 252Zeile 263
}

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

}

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

{
// Verify incoming POST request

{
// Verify incoming POST request

	verify_post_check($mybb->get_input('my_post_key'));

	verify_post_check($mybb->get_input('my_post_key'));





	$plugins->run_hooks("editpost_deletepost");

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

	$plugins->run_hooks("editpost_deletepost");

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

Zeile 265Zeile 276
		if($firstcheck['pid'] == $pid)
{
$firstpost = 1;

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

		}

		}

		else

		else

		{

		{

			$firstpost = 0;
}


			$firstpost = 0;
}


Zeile 276Zeile 287
		if($firstpost)
{
if($forumpermissions['candeletethreads'] == 1 || is_moderator($fid, "candeletethreads") || is_moderator($fid, "cansoftdeletethreads"))

		if($firstpost)
{
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 || is_moderator($fid, "cansoftdeletethreads"))
{
$modlogdata['pid'] = $pid;

$moderation->soft_delete_threads(array($tid));
log_moderator_action($modlogdata, $lang->thread_soft_deleted);

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

$moderation->soft_delete_threads(array($tid));
log_moderator_action($modlogdata, $lang->thread_soft_deleted);

				}
else

				}
else

				{
$moderation->delete_thread($tid);
mark_reports($tid, "thread");

				{
$moderation->delete_thread($tid);
mark_reports($tid, "thread");

Zeile 298Zeile 309
				{
header("Content-type: application/json; charset={$lang->settings['charset']}");
if(is_moderator($fid, "canviewdeleted"))

				{
header("Content-type: application/json; charset={$lang->settings['charset']}");
if(is_moderator($fid, "canviewdeleted"))

					{

					{

						echo json_encode(array("data" => '1', "first" => '1'));

						echo json_encode(array("data" => '1', "first" => '1'));

					}

					}

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

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

Zeile 309Zeile 320
				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 332Zeile 343
					log_moderator_action($modlogdata, $lang->post_soft_deleted);
}
else

					log_moderator_action($modlogdata, $lang->post_soft_deleted);
}
else

				{

				{

					$moderation->delete_post($pid);
mark_reports($pid, "post");
log_moderator_action($modlogdata, $lang->post_deleted);

					$moderation->delete_post($pid);
mark_reports($pid, "post");
log_moderator_action($modlogdata, $lang->post_deleted);

Zeile 343Zeile 354
				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
{
$redirect = get_thread_link($tid);

				else
{
$redirect = get_thread_link($tid);

Zeile 521Zeile 532

// Help keep our attachments table clean.
$db->delete_query("attachments", "filename='' OR filesize<1");


// Help keep our attachments table clean.
$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', MyBB::INPUT_INT) && $forumpermissions['canpostpolls'])

		// Did the user choose to post a poll? Redirect them to the poll posting page.
if($mybb->get_input('postpoll', MyBB::INPUT_INT) && $forumpermissions['canpostpolls'])

		{

		{

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

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

Zeile 533Zeile 544
			// Moderated post
$lang->redirect_postedited .= $lang->redirect_thread_moderation;
$url = get_forum_link($fid);

			// Moderated post
$lang->redirect_postedited .= $lang->redirect_thread_moderation;
$url = get_forum_link($fid);

		}

		}

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

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

Zeile 611Zeile 622
			if($attachment['visible'] != 1)
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");

			if($attachment['visible'] != 1)
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment_unapproved")."\";");

			}

			}

			else
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";");

			else
{
eval("\$attachments .= \"".$templates->get("post_attachments_attachment")."\";");

Zeile 623Zeile 634
		if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)
{
$noshowattach = 1;

		if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)
{
$noshowattach = 1;

		}

		}

		else
{
$noshowattach = 0;

		else
{
$noshowattach = 0;

Zeile 666Zeile 677
		$subject = $mybb->get_input('subject');
$reason = htmlspecialchars_uni($mybb->get_input('editreason'));
}

		$subject = $mybb->get_input('subject');
$reason = htmlspecialchars_uni($mybb->get_input('editreason'));
}

 

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


if(!isset($post_errors))
{


if(!isset($post_errors))
{

Zeile 700Zeile 716
			$postoptions['signature'] = 0;
}
if(!isset($postoptions['emailnotify']))

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

		{

		{

			$postoptions['emailnotify'] = 0;
}
if(!isset($postoptions['disablesmilies']))

			$postoptions['emailnotify'] = 0;
}
if(!isset($postoptions['disablesmilies']))

Zeile 727Zeile 743
		}
else
{

		}
else
{

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

 

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

if(isset($postoptions['signature']) && $postoptions['signature'] == 1)
{
$postoptionschecked['signature'] = " checked=\"checked\"";


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

if(isset($postoptions['signature']) && $postoptions['signature'] == 1)
{
$postoptionschecked['signature'] = " 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 793Zeile 805
	}
else if(!$post_errors)
{

	}
else if(!$post_errors)
{

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


 
		$preview = '';

if($post['includesig'] != 0)

		$preview = '';

if($post['includesig'] != 0)