"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/editpost.php" between
mybb_1822.zip and mybb_1823.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

editpost.php  (mybb_1822):editpost.php  (mybb_1823)
skipping to change at line 195 skipping to change at line 195
// Check if this forum is password protected and we have a valid password // Check if this forum is password protected and we have a valid password
check_forum_password($forum['fid']); check_forum_password($forum['fid']);
if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPU T_INT) == '1') if((empty($_POST) && empty($_FILES)) && $mybb->get_input('processed', MyBB::INPU T_INT) == '1')
{ {
error($lang->error_empty_post_input); error($lang->error_empty_post_input);
} }
$attacherror = ''; $attacherror = '';
if($mybb->settings['enableattachments'] == 1 && !$mybb->get_input('attachmentaid ', MyBB::INPUT_INT) && ($mybb->get_input('newattachment') || $mybb->get_input('u pdateattachment') || ($mybb->input['action'] == "do_editpost" && isset($mybb->in put['submit']) && $_FILES['attachment']))) if($mybb->settings['enableattachments'] == 1 && ($mybb->get_input('newattachment ') || $mybb->get_input('updateattachment') || ((($mybb->input['action'] == "do_e ditpost" && isset($mybb->input['submitbutton'])) || ($mybb->input['action'] == " editpost" && isset($mybb->input['previewpost']))) && $_FILES['attachments'])))
{ {
// 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'));
if($pid) if($pid)
{ {
$attachwhere = "pid='{$pid}'"; $attachwhere = "pid='{$pid}'";
} }
else else
{ {
skipping to change at line 223 skipping to change at line 223
$errors = $ret['errors']; $errors = $ret['errors'];
} }
// Do we have attachment errors? // Do we have attachment errors?
if(!empty($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'])) if(!isset($mybb->input['submitbutton']))
{ {
$mybb->input['action'] = "editpost"; $mybb->input['action'] = "editpost";
} }
} }
detect_attachmentact();
if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid' , MyBB::INPUT_INT) && isset($mybb->input['attachmentact']) && $mybb->input['acti on'] == "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['acti on'] == "do_editpost" && $mybb->request_method == "post") // Lets remove/approve /unapprove the attachment
{ {
// 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'));
$mybb->input['attachmentaid'] = $mybb->get_input('attachmentaid', MyBB::I NPUT_INT); $mybb->input['attachmentaid'] = $mybb->get_input('attachmentaid', MyBB::I NPUT_INT);
if($mybb->input['attachmentact'] == "remove") if($mybb->input['attachmentact'] == "remove")
{ {
remove_attachment($pid, "", $mybb->input['attachmentaid']); remove_attachment($pid, "", $mybb->input['attachmentaid']);
} }
skipping to change at line 259 skipping to change at line 261
update_thread_counters($post['tid'], array('attachmentcount' => " -1")); update_thread_counters($post['tid'], array('attachmentcount' => " -1"));
} }
if($mybb->get_input('ajax', MyBB::INPUT_INT) == 1) if($mybb->get_input('ajax', MyBB::INPUT_INT) == 1)
{ {
header("Content-type: application/json; charset={$lang->settings[ 'charset']}"); header("Content-type: application/json; charset={$lang->settings[ 'charset']}");
echo json_encode(array("success" => true)); echo json_encode(array("success" => true));
exit(); exit();
} }
if(!isset($mybb->input['submit'])) if(!isset($mybb->input['submitbutton']))
{ {
$mybb->input['action'] = "editpost"; $mybb->input['action'] = "editpost";
} }
} }
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'));
skipping to change at line 583 skipping to change at line 585
if($forum['allowpicons'] != 0) if($forum['allowpicons'] != 0)
{ {
$posticons = get_post_icons(); $posticons = get_post_icons();
} }
$mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']); $mybb->user['username'] = htmlspecialchars_uni($mybb->user['username']);
eval("\$loginbox = \"".$templates->get("changeuserbox")."\";"); eval("\$loginbox = \"".$templates->get("changeuserbox")."\";");
$deletebox = ''; $deletebox = '';
// Can we delete posts? if($post['visible'] != -1 && (($thread['firstpost'] == $pid && (is_modera
if($post['visible'] != -1 && (is_moderator($fid, "candeleteposts") || $fo tor($fid, "candeletethreads") || $forumpermissions['candeletethreads'] == 1 && $
rumpermissions['candeleteposts'] == 1 && $mybb->user['uid'] == $post['uid'])) mybb->user['uid'] == $post['uid'])) || ($thread['firstpost'] != $pid && (is_mode
rator($fid, "candeleteposts") || $forumpermissions['candeleteposts'] == 1 && $my
bb->user['uid'] == $post['uid']))))
{ {
eval("\$deletebox = \"".$templates->get("editpost_delete")."\";") ; eval("\$deletebox = \"".$templates->get("editpost_delete")."\";") ;
} }
$bgcolor = "trow1"; $bgcolor = "trow1";
if($mybb->settings['enableattachments'] != 0 && $forumpermissions['canpos tattachments'] != 0) if($mybb->settings['enableattachments'] != 0 && $forumpermissions['canpos tattachments'] != 0)
{ // Get a listing of the current attachments, if there are any { // Get a listing of the current attachments, if there are any
$attachcount = 0; $attachcount = 0;
$query = $db->simple_select("attachments", "*", "pid='{$pid}'"); $query = $db->simple_select("attachments", "*", "pid='{$pid}'");
$attachments = ''; $attachments = '';
 End of changes. 5 change blocks. 
6 lines changed or deleted 10 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)