"Fossies" - the Fresh Open Source Software Archive  

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

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

newthread.php  (mybb_1822):newthread.php  (mybb_1823)
skipping to change at line 17 skipping to change at line 17
* License: http://www.mybb.com/about/license * License: http://www.mybb.com/about/license
* *
*/ */
define("IN_MYBB", 1); define("IN_MYBB", 1);
define('THIS_SCRIPT', 'newthread.php'); define('THIS_SCRIPT', 'newthread.php');
$templatelist = "newthread,previewpost,loginbox,changeuserbox,newthread_postpoll ,posticons,codebuttons,postbit,post_attachments_attachment_unapproved,newreply_m odoptions_close,newreply_modoptions_stick"; $templatelist = "newthread,previewpost,loginbox,changeuserbox,newthread_postpoll ,posticons,codebuttons,postbit,post_attachments_attachment_unapproved,newreply_m odoptions_close,newreply_modoptions_stick";
$templatelist .= ",newthread_disablesmilies,post_attachments_new,post_attachment s,post_savedraftbutton,post_subscription_method,post_attachments_attachment_remo ve,postbit_warninglevel_formatted,postbit_icon"; $templatelist .= ",newthread_disablesmilies,post_attachments_new,post_attachment s,post_savedraftbutton,post_subscription_method,post_attachments_attachment_remo ve,postbit_warninglevel_formatted,postbit_icon";
$templatelist .= ",forumdisplay_rules,forumdisplay_rules_link,post_attachments_a ttachment_postinsert,post_attachments_attachment,newthread_signature,post_prefix select_prefix,post_prefixselect_single,posticons_icon"; $templatelist .= ",forumdisplay_rules,forumdisplay_rules_link,post_attachments_a ttachment_postinsert,post_attachments_attachment,newthread_signature,post_prefix select_prefix,post_prefixselect_single,posticons_icon";
$templatelist .= ",post_captcha_hidden,post_captcha_recaptcha_invisible,post_cap tcha_nocaptcha,post_javascript,postbit_gotopost,newthread_postoptions,post_attac hments_add,post_attachments_viewlink"; $templatelist .= ",post_captcha_hidden,post_captcha_recaptcha_invisible,post_cap tcha_nocaptcha,post_captcha_hcaptcha_invisible,post_captcha_hcaptcha,post_javasc ript,postbit_gotopost,newthread_postoptions,post_attachments_add,post_attachment s_viewlink";
$templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,pos tbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,post bit_author_user,postbit_author_guest,post_captcha"; $templatelist .= ",postbit_avatar,postbit_find,postbit_pm,postbit_rep_button,pos tbit_www,postbit_email,postbit_reputation,postbit_warn,postbit_warninglevel,post bit_author_user,postbit_author_guest,post_captcha";
$templatelist .= ",postbit_signature,postbit_classic,postbit_attachments_thumbna ils_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,po stbit_attachments_attachment_unapproved"; $templatelist .= ",postbit_signature,postbit_classic,postbit_attachments_thumbna ils_thumbnail,postbit_attachments_images_image,postbit_attachments_attachment,po stbit_attachments_attachment_unapproved";
$templatelist .= ",postbit_attachments_thumbnails,postbit_attachments_images,pos tbit_attachments,postbit_reputation_formatted_link,post_attachments_update,postb it_offline,newreply_modoptions,newthread_multiquote_external"; $templatelist .= ",postbit_attachments_thumbnails,postbit_attachments_images,pos tbit_attachments,postbit_reputation_formatted_link,post_attachments_update,postb it_offline,newreply_modoptions,newthread_multiquote_external";
$templatelist .= ",postbit_profilefield_multiselect_value,postbit_profilefield_m ultiselect,newthread_draftinput,global_moderation_notice,postbit_online,postbit_ away,attachment_icon,postbit_userstar,postbit_groupimage"; $templatelist .= ",postbit_profilefield_multiselect_value,postbit_profilefield_m ultiselect,newthread_draftinput,global_moderation_notice,postbit_online,postbit_ away,attachment_icon,postbit_userstar,postbit_groupimage";
require_once "./global.php"; require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php"; require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_user.php"; require_once MYBB_ROOT."inc/functions_user.php";
// Load global language phrases // Load global language phrases
skipping to change at line 160 skipping to change at line 160
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);
} }
$errors = array(); $errors = array();
$maximageserror = $attacherror = ''; $maximageserror = $attacherror = '';
// Handle attachments if we've got any. // Handle attachments if we've got any.
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_newthread" && $mybb->get_inp ut('submit') && $_FILES['attachment']))) if($mybb->settings['enableattachments'] == 1 && ($mybb->get_input('newattachment ') || $mybb->get_input('updateattachment') || ((($mybb->input['action'] == "do_n ewthread" && $mybb->get_input('submit')) || ($mybb->input['action'] == "newthrea d" && isset($mybb->input['previewpost'])) || isset($mybb->input['savedraft'])) & & $_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($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb ->input['pid'])) if($mybb->input['action'] == "editdraft" || ($mybb->input['tid'] && $mybb ->input['pid']))
{ {
$attachwhere = "pid='{$pid}'"; $attachwhere = "pid='{$pid}'";
} }
else else
{ {
skipping to change at line 183 skipping to change at line 183
require_once MYBB_ROOT."inc/functions_upload.php"; require_once MYBB_ROOT."inc/functions_upload.php";
$ret = add_attachments($pid, $forumpermissions, $attachwhere, "newthread" ); $ret = add_attachments($pid, $forumpermissions, $attachwhere, "newthread" );
if(!empty($ret['errors'])) if(!empty($ret['errors']))
{ {
$errors = $ret['errors']; $errors = $ret['errors'];
} }
// If we were dealing with an attachment but didn't click 'Post Thread', // If we were dealing with an attachment but didn't click 'Post Thread' o
force the new thread page again. r 'Save as Draft', force the new thread page again.
if(!$mybb->get_input('submit')) if(!$mybb->get_input('submit') && !$mybb->get_input('savedraft'))
{ {
$mybb->input['action'] = "newthread"; $mybb->input['action'] = "newthread";
} }
} }
detect_attachmentact();
// Are we removing an attachment from the thread? // Are we removing an attachment from the thread?
if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid' , MyBB::INPUT_INT) && $mybb->get_input('attachmentact') == "remove") if($mybb->settings['enableattachments'] == 1 && $mybb->get_input('attachmentaid' , MyBB::INPUT_INT) && $mybb->get_input('attachmentact') == "remove")
{ {
// 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'));
require_once MYBB_ROOT."inc/functions_upload.php"; require_once MYBB_ROOT."inc/functions_upload.php";
remove_attachment($pid, $mybb->get_input('posthash'), $mybb->get_input('a ttachmentaid', MyBB::INPUT_INT)); remove_attachment($pid, $mybb->get_input('posthash'), $mybb->get_input('a ttachmentaid', MyBB::INPUT_INT));
if(!$mybb->get_input('submit')) if(!$mybb->get_input('submit'))
{ {
skipping to change at line 1031 skipping to change at line 1033
$captcha = $post_captcha->build_hidden_captcha(); $captcha = $post_captcha->build_hidden_captcha();
} }
} }
if(!$correct) if(!$correct)
{ {
if($post_captcha->type == 1) if($post_captcha->type == 1)
{ {
$post_captcha->build_captcha(); $post_captcha->build_captcha();
} }
elseif(in_array($post_captcha->type, array(4, 5))) elseif(in_array($post_captcha->type, array(4, 5, 8)))
{ {
$post_captcha->build_recaptcha(); $post_captcha->build_recaptcha();
} }
elseif(in_array($post_captcha->type, array(6, 7)))
{
$post_captcha->build_hcaptcha();
}
} }
else if($correct && (in_array($post_captcha->type, array(4, 5)))) else if($correct && (in_array($post_captcha->type, array(4, 5, 8) )))
{ {
$post_captcha->build_recaptcha(); $post_captcha->build_recaptcha();
} }
else if($correct && (in_array($post_captcha->type, array(6, 7))))
{
$post_captcha->build_hcaptcha();
}
if($post_captcha->html) if($post_captcha->html)
{ {
$captcha = $post_captcha->html; $captcha = $post_captcha->html;
} }
} }
if($forumpermissions['canpostpolls'] != 0) if($forumpermissions['canpostpolls'] != 0)
{ {
$lang->max_options = $lang->sprintf($lang->max_options, $mybb->se ttings['maxpolloptions']); $lang->max_options = $lang->sprintf($lang->max_options, $mybb->se ttings['maxpolloptions']);
 End of changes. 8 change blocks. 
7 lines changed or deleted 17 lines changed or added

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