"Fossies" - the Fresh Open Source Software Archive  

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

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

newreply.php  (mybb_1822):newreply.php  (mybb_1823)
skipping to change at line 18 skipping to change at line 18
* *
*/ */
define("IN_MYBB", 1); define("IN_MYBB", 1);
define('THIS_SCRIPT', 'newreply.php'); define('THIS_SCRIPT', 'newreply.php');
$templatelist = "newreply,previewpost,loginbox,changeuserbox,posticons,newreply_ threadreview,newreply_threadreview_post,forumdisplay_rules_link,newreply_multiqu ote_external,post_attachments_add,post_subscription_method"; $templatelist = "newreply,previewpost,loginbox,changeuserbox,posticons,newreply_ threadreview,newreply_threadreview_post,forumdisplay_rules_link,newreply_multiqu ote_external,post_attachments_add,post_subscription_method";
$templatelist .= ",codebuttons,post_attachments_new,post_attachments,post_savedr aftbutton,newreply_modoptions,newreply_threadreview_more,postbit_online,postbit_ pm,newreply_disablesmilies_hidden,post_attachments_update"; $templatelist .= ",codebuttons,post_attachments_new,post_attachments,post_savedr aftbutton,newreply_modoptions,newreply_threadreview_more,postbit_online,postbit_ pm,newreply_disablesmilies_hidden,post_attachments_update";
$templatelist .= ",postbit_warninglevel,postbit_author_user,postbit_edit,postbit _quickdelete,postbit_inlinecheck,postbit_posturl,postbit_quote,postbit_multiquot e,newreply_modoptions_close,newreply_modoptions_stick"; $templatelist .= ",postbit_warninglevel,postbit_author_user,postbit_edit,postbit _quickdelete,postbit_inlinecheck,postbit_posturl,postbit_quote,postbit_multiquot e,newreply_modoptions_close,newreply_modoptions_stick";
$templatelist .= ",post_attachments_attachment_postinsert,post_attachments_attac hment_remove,post_attachments_attachment_unapproved,post_attachments_attachment, post_attachments_viewlink,postbit_attachments_attachment,newreply_signature"; $templatelist .= ",post_attachments_attachment_postinsert,post_attachments_attac hment_remove,post_attachments_attachment_unapproved,post_attachments_attachment, post_attachments_viewlink,postbit_attachments_attachment,newreply_signature";
$templatelist .= ",post_captcha_recaptcha_invisible,post_captcha_hidden,post_cap tcha,post_captcha_nocaptcha,post_javascript,postbit_groupimage,postbit_attachmen ts,newreply_postoptions"; $templatelist .= ",post_captcha_recaptcha_invisible,post_captcha_hidden,post_cap tcha,post_captcha_nocaptcha,post_captcha_hcaptcha_invisible,post_captcha_hcaptch a,post_javascript,postbit_groupimage,postbit_attachments,newreply_postoptions";
$templatelist .= ",postbit_rep_button,postbit_author_guest,postbit_signature,pos tbit_classic,postbit_attachments_thumbnails_thumbnailpostbit_attachments_images_ image,postbit_attachments_attachment_unapproved"; $templatelist .= ",postbit_rep_button,postbit_author_guest,postbit_signature,pos tbit_classic,postbit_attachments_thumbnails_thumbnailpostbit_attachments_images_ image,postbit_attachments_attachment_unapproved";
$templatelist .= ",postbit_attachments_thumbnails,postbit_attachments_images,pos tbit_gotopost,forumdisplay_password_wrongpass,forumdisplay_password,posticons_ic on,attachment_icon,postbit_reputation_formatted_link"; $templatelist .= ",postbit_attachments_thumbnails,postbit_attachments_images,pos tbit_gotopost,forumdisplay_password_wrongpass,forumdisplay_password,posticons_ic on,attachment_icon,postbit_reputation_formatted_link";
$templatelist .= ",global_moderation_notice,newreply_disablesmilies,postbit_user star,newreply_draftinput,postbit_avatar,forumdisplay_rules,postbit_offline,postb it_find,postbit_warninglevel_formatted,postbit_ignored"; $templatelist .= ",global_moderation_notice,newreply_disablesmilies,postbit_user star,newreply_draftinput,postbit_avatar,forumdisplay_rules,postbit_offline,postb it_find,postbit_warninglevel_formatted,postbit_ignored";
$templatelist .= ",postbit_profilefield_multiselect_value,postbit_profilefield_m ultiselect,postbit_reputation,postbit_www,postbit_away,postbit_icon,postbit_emai l,postbit_report,postbit,postbit_warn"; $templatelist .= ",postbit_profilefield_multiselect_value,postbit_profilefield_m ultiselect,postbit_reputation,postbit_www,postbit_away,postbit_icon,postbit_emai l,postbit_report,postbit,postbit_warn";
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";
require_once MYBB_ROOT."inc/class_parser.php"; require_once MYBB_ROOT."inc/class_parser.php";
$parser = new postParser; $parser = new postParser;
skipping to change at line 206 skipping to change at line 206
$mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].random_s tr()); $mybb->input['posthash'] = md5($thread['tid'].$mybb->user['uid'].random_s tr());
} }
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 = '';
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_newreply" && $mybb->get_inpu t('submit') && $_FILES['attachment']))) if($mybb->settings['enableattachments'] == 1 && ($mybb->get_input('newattachment ') || $mybb->get_input('updateattachment') || ((($mybb->input['action'] == "do_n ewreply" && $mybb->get_input('submit')) || ($mybb->input['action'] == "newreply" && 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($pid) if($pid)
{ {
$attachwhere = "pid='{$pid}'"; $attachwhere = "pid='{$pid}'";
} }
else else
{ {
skipping to change at line 229 skipping to change at line 229
require_once MYBB_ROOT."inc/functions_upload.php"; require_once MYBB_ROOT."inc/functions_upload.php";
$ret = add_attachments($pid, $forumpermissions, $attachwhere, "newreply") ; $ret = add_attachments($pid, $forumpermissions, $attachwhere, "newreply") ;
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 Reply', f // If we were dealing with an attachment but didn't click 'Post Reply' or
orce the new reply page again. 'Save as Draft', force the new reply page again.
if(!$mybb->get_input('submit')) if(!$mybb->get_input('submit') && !$mybb->get_input('savedraft'))
{ {
eval("\$editdraftpid = \"".$templates->get("newreply_draftinput") ."\";"); eval("\$editdraftpid = \"".$templates->get("newreply_draftinput") ."\";");
$mybb->input['action'] = "newreply"; $mybb->input['action'] = "newreply";
} }
} }
detect_attachmentact();
// Remove an attachment. // Remove an attachment.
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 702 skipping to change at line 704
} }
} }
// Show the newreply form. // Show the newreply form.
if($mybb->input['action'] == "newreply" || $mybb->input['action'] == "editdraft" ) if($mybb->input['action'] == "newreply" || $mybb->input['action'] == "editdraft" )
{ {
$plugins->run_hooks("newreply_start"); $plugins->run_hooks("newreply_start");
$quote_ids = $multiquote_external = ''; $quote_ids = $multiquote_external = '';
// If this isn't a preview and we're not editing a draft, then handle quo ted posts // If this isn't a preview and we're not editing a draft, then handle quo ted posts
if(empty($mybb->input['previewpost']) && !$reply_errors && $mybb->input[' action'] != "editdraft" && !$mybb->get_input('attachmentaid', MyBB::INPUT_INT) & & !$mybb->get_input('newattachment') && !$mybb->get_input('updateattachment') && !$mybb->get_input('rem')) if(empty($mybb->input['previewpost']) && !$reply_errors && $mybb->input[' action'] != "editdraft" && !$mybb->get_input('attachmentaid', MyBB::INPUT_INT) & & !$mybb->get_input('newattachment') && !$mybb->get_input('updateattachment'))
{ {
$message = ''; $message = '';
$quoted_posts = array(); $quoted_posts = array();
// Handle multiquote // Handle multiquote
if(isset($mybb->cookies['multiquote']) && $mybb->settings['multiq uote'] != 0) if(isset($mybb->cookies['multiquote']) && $mybb->settings['multiq uote'] != 0)
{ {
$multiquoted = explode("|", $mybb->cookies['multiquote']) ; $multiquoted = explode("|", $mybb->cookies['multiquote']) ;
foreach($multiquoted as $post) foreach($multiquoted as $post)
{ {
$quoted_posts[$post] = (int)$post; $quoted_posts[$post] = (int)$post;
skipping to change at line 1177 skipping to change at line 1179
$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;
} }
} }
$reviewmore = ''; $reviewmore = '';
if($mybb->settings['threadreview'] != 0) if($mybb->settings['threadreview'] != 0)
{ {
 End of changes. 9 change blocks. 
8 lines changed or deleted 18 lines changed or added

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