Vergleich editpost.php - 1.8.18 - 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 124Zeile 127
			error($lang->redirect_threadclosed);
}
if($forumpermissions['candeleteposts'] == 0 && $pid != $thread['firstpost'] || $forumpermissions['candeletethreads'] == 0 && $pid == $thread['firstpost'])

			error($lang->redirect_threadclosed);
}
if($forumpermissions['candeleteposts'] == 0 && $pid != $thread['firstpost'] || $forumpermissions['candeletethreads'] == 0 && $pid == $thread['firstpost'])

		{
error_no_permission();
}

		{
error_no_permission();
}

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

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

		// User can't delete unapproved post
if($post['visible'] == 0)

		// 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();
}

		{
error_no_permission();
}

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 190Zeile 193

$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'])))

{
// 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)

	{

	{

		$attachwhere = "pid='{$pid}'";

		$attachwhere = "pid='{$pid}'";

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

$ret = add_attachments($pid, $forumpermissions, $attachwhere, "editpost");

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

$ret = add_attachments($pid, $forumpermissions, $attachwhere, "editpost");


if(!empty($ret['errors']))


if(!empty($ret['errors']))

	{

	{

		$errors = $ret['errors'];
}


		$errors = $ret['errors'];
}


Zeile 214Zeile 217
	if(!empty($errors))
{
$attacherror = inline_error($errors);

	if(!empty($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(!isset($mybb->input['submit']))


// If we were dealing with an attachment but didn't click 'Update Post', force the post edit page again.
if(!isset($mybb->input['submit']))

Zeile 234Zeile 237
		remove_attachment($pid, "", $mybb->input['attachmentaid']);
}
elseif($mybb->get_input('attachmentact') == "approve" && is_moderator($fid, 'canapproveunapproveattachs'))

		remove_attachment($pid, "", $mybb->input['attachmentaid']);
}
elseif($mybb->get_input('attachmentact') == "approve" && is_moderator($fid, 'canapproveunapproveattachs'))

	{

	{

		$update_sql = array("visible" => 1);

		$update_sql = array("visible" => 1);

		$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");

		$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");

		update_thread_counters($post['tid'], array('attachmentcount' => "+1"));

		update_thread_counters($post['tid'], array('attachmentcount' => "+1"));

	}

	}

	elseif($mybb->get_input('attachmentact') == "unapprove" && is_moderator($fid, 'canapproveunapproveattachs'))
{
$update_sql = array("visible" => 0);
$db->update_query("attachments", $update_sql, "aid='{$mybb->input['attachmentaid']}'");
update_thread_counters($post['tid'], array('attachmentcount' => "-1"));
}

	elseif($mybb->get_input('attachmentact') == "unapprove" && is_moderator($fid, 'canapproveunapproveattachs'))
{
$update_sql = array("visible" => 0);
$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 524Zeile 535

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

		}

		}

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

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

		{

		{

			// 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']))

			// 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;
$url = get_thread_link($tid);

			$lang->redirect_postedited .= $lang->redirect_post_moderation;
$url = get_thread_link($tid);

		}

		}

		// Otherwise, send them back to their post
else
{

		// Otherwise, send them back to their post
else
{

Zeile 546Zeile 557
			$url = get_post_link($pid, $tid)."#pid{$pid}";
}
$plugins->run_hooks("editpost_do_editpost_end");

			$url = get_post_link($pid, $tid)."#pid{$pid}";
}
$plugins->run_hooks("editpost_do_editpost_end");





		redirect($url, $lang->redirect_postedited);
}
}

		redirect($url, $lang->redirect_postedited);
}
}

Zeile 558Zeile 569
	if(!isset($mybb->input['previewpost']))
{
$icon = $post['icon'];

	if(!isset($mybb->input['previewpost']))
{
$icon = $post['icon'];

	}

	}


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


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

Zeile 603Zeile 614
				{
eval("\$attach_mod_options = \"".$templates->get("post_attachments_attachment_mod_approve")."\";");
}

				{
eval("\$attach_mod_options = \"".$templates->get("post_attachments_attachment_mod_approve")."\";");
}

			}

			}


// Remove Attachment
eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");

if($attachment['visible'] != 1)


// Remove Attachment
eval("\$attach_rem_options = \"".$templates->get("post_attachments_attachment_remove")."\";");

if($attachment['visible'] != 1)

			{

			{

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

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

			}

			}

			$attachcount++;

			$attachcount++;

		}

		}

		$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);
if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)

		$query = $db->simple_select("attachments", "SUM(filesize) AS ausage", "uid='".$mybb->user['uid']."'");
$usage = $db->fetch_array($query);
if($usage['ausage'] > ($mybb->usergroup['attachquota']*1024) && $mybb->usergroup['attachquota'] != 0)

		{

		{

			$noshowattach = 1;

			$noshowattach = 1;

		}
else
{

		}
else
{

			$noshowattach = 0;
}
if($mybb->usergroup['attachquota'] == 0)

			$noshowattach = 0;
}
if($mybb->usergroup['attachquota'] == 0)

Zeile 646Zeile 657
		if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0)
{
eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");

		if(($mybb->usergroup['caneditattachments'] || $forumpermissions['caneditattachments']) && $attachcount > 0)
{
eval("\$attach_update_options = \"".$templates->get("post_attachments_update")."\";");

		}


		}


		if($attach_add_options || $attach_update_options)
{
eval("\$newattach = \"".$templates->get("post_attachments_new")."\";");

		if($attach_add_options || $attach_update_options)
{
eval("\$newattach = \"".$templates->get("post_attachments_new")."\";");

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

	{

	{

		$post_errors = '';
}


		$post_errors = '';
}


	$postoptions_subscriptionmethod_dont = $postoptions_subscriptionmethod_none = $postoptions_subscriptionmethod_email = $postoptions_subscriptionmethod_pm = '';

	$subscribe = $nonesubscribe = $emailsubscribe = $pmsubscribe = '';

	$postoptionschecked = array('signature' => '', 'disablesmilies' => '');

if(!empty($mybb->input['previewpost']) || $post_errors)

	$postoptionschecked = array('signature' => '', 'disablesmilies' => '');

if(!empty($mybb->input['previewpost']) || $post_errors)

Zeile 702Zeile 718
		if(!isset($postoptions['emailnotify']))
{
$postoptions['emailnotify'] = 0;

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

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

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


// Set up the post options from the input.
$post['options'] = array(


// Set up the post options from the input.
$post['options'] = array(

Zeile 724Zeile 740
			$post_errors = inline_error($post_errors);
$mybb->input['action'] = "editpost";
$mybb->input['previewpost'] = 0;

			$post_errors = inline_error($post_errors);
$mybb->input['action'] = "editpost";
$mybb->input['previewpost'] = 0;

		}
else
{
$previewmessage = $message;
$previewsubject = $subject;
$message = htmlspecialchars_uni($message);
$subject = htmlspecialchars_uni($subject);

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


		}
else
{

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






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

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

			{

			{

				$postoptionschecked['signature'] = " 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\"";
}

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


			}

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

$subscription_method = get_subscription_method($tid, $postoptions);
${$subscription_method.'subscribe'} = "checked=\"checked\" ";
}
}
















	if(!empty($mybb->input['previewpost']))
{
if(!$post['uid'])

	if(!empty($mybb->input['previewpost']))
{
if(!$post['uid'])

Zeile 783Zeile 781
			");
$postinfo = $db->fetch_array($query);
$postinfo['userusername'] = $postinfo['username'];

			");
$postinfo = $db->fetch_array($query);
$postinfo['userusername'] = $postinfo['username'];

		}


		}


		$query = $db->simple_select("attachments", "*", "pid='{$pid}'");
while($attachment = $db->fetch_array($query))
{

		$query = $db->simple_select("attachments", "*", "pid='{$pid}'");
while($attachment = $db->fetch_array($query))
{

Zeile 807Zeile 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)

Zeile 822Zeile 817
			$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}


			$postoptionschecked['disablesmilies'] = " checked=\"checked\"";
}


		$query = $db->simple_select("threadsubscriptions", "notification", "tid='{$tid}' AND uid='{$mybb->user['uid']}'");
if($db->num_rows($query) > 0)
{
$notification = $db->fetch_field($query, 'notification');

if($notification == 0)
{
$postoptions_subscriptionmethod_none = "checked=\"checked\"";
}
else if($notification == 1)
{
$postoptions_subscriptionmethod_email = "checked=\"checked\"";
}
else if($notification == 2)
{
$postoptions_subscriptionmethod_pm = "checked=\"checked\"";
}
else
{
$postoptions_subscriptionmethod_dont = "checked=\"checked\"";
}
}

		$subscription_method = get_subscription_method($tid, $postoptions);
${$subscription_method.'subscribe'} = "checked=\"checked\" ";





















	}

// Generate thread prefix selector if this is the first post of the thread

	}

// Generate thread prefix selector if this is the first post of the thread