"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/newreply.php" between
mybb_1819.zip and mybb_1820.zip

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

newreply.php  (mybb_1819):newreply.php  (mybb_1820)
skipping to change at line 91 skipping to change at line 91
$thread_subject = $thread['subject']; $thread_subject = $thread['subject'];
$thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subje ct'])); $thread['subject'] = htmlspecialchars_uni($parser->parse_badwords($thread['subje ct']));
add_breadcrumb($thread['subject'], get_thread_link($thread['tid'])); add_breadcrumb($thread['subject'], get_thread_link($thread['tid']));
add_breadcrumb($lang->nav_newreply); add_breadcrumb($lang->nav_newreply);
$forumpermissions = forum_permissions($fid); $forumpermissions = forum_permissions($fid);
// See if everything is valid up to here. // See if everything is valid up to here.
if(isset($post) && (($post['visible'] == 0 && !is_moderator($fid, "canviewunappr ove")) || ($post['visible'] < 0 && $post['uid'] != $mybb->user['uid']))) if(isset($post) && (($post['visible'] == 0 && !is_moderator($fid, "canviewunappr ove")) || ($post['visible'] < 0 && $post['uid'] != $mybb->user['uid'])))
{ {
error($lang->error_invalidpost); if($post['visible'] == 0 && !($mybb->settings['showownunapproved'] && $po
st['uid'] == $mybb->user['uid']))
{
error($lang->error_invalidpost);
}
} }
if(($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove")) || $thre ad['visible'] < 0) if(($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove")) || $thre ad['visible'] < 0)
{ {
error($lang->error_invalidthread); if($thread['visible'] == 0 && !($mybb->settings['showownunapproved'] && $
thread['uid'] == $mybb->user['uid']))
{
error($lang->error_invalidthread);
}
} }
if($forum['open'] == 0 || $forum['type'] != "f") if($forum['open'] == 0 || $forum['type'] != "f")
{ {
error($lang->error_closedinvalidforum); error($lang->error_closedinvalidforum);
} }
if($forumpermissions['canview'] == 0 || $forumpermissions['canpostreplys'] == 0) if($forumpermissions['canview'] == 0 || $forumpermissions['canpostreplys'] == 0)
{ {
error_no_permission(); error_no_permission();
} }
skipping to change at line 244 skipping to change at line 250
// 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'))
{ {
eval("\$editdraftpid = \"".$templates->get("newreply_draftinput") ."\";"); eval("\$editdraftpid = \"".$templates->get("newreply_draftinput") ."\";");
$mybb->input['action'] = "newreply"; $mybb->input['action'] = "newreply";
} }
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();
}
} }
$reply_errors = ''; $reply_errors = '';
$quoted_ids = array(); $quoted_ids = array();
$hide_captcha = false; $hide_captcha = false;
// Check the maximum posts per day for this user // Check the maximum posts per day for this user
if($mybb->usergroup['maxposts'] > 0 && $mybb->usergroup['cancp'] != 1) if($mybb->usergroup['maxposts'] > 0 && $mybb->usergroup['cancp'] != 1)
{ {
$daycut = TIME_NOW-60*60*24; $daycut = TIME_NOW-60*60*24;
skipping to change at line 1188 skipping to change at line 1201
} }
$reviewmore = ''; $reviewmore = '';
if($mybb->settings['threadreview'] != 0) if($mybb->settings['threadreview'] != 0)
{ {
if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['post sperpage'] < 1) if(!$mybb->settings['postsperpage'] || (int)$mybb->settings['post sperpage'] < 1)
{ {
$mybb->settings['postsperpage'] = 20; $mybb->settings['postsperpage'] = 20;
} }
if(is_moderator($fid, "canviewunapprove")) if(is_moderator($fid, "canviewunapprove") || $mybb->settings['sho wownunapproved'])
{ {
$visibility = "(visible='1' OR visible='0')"; $visibility = "(visible='1' OR visible='0')";
} }
else else
{ {
$visibility = "visible='1'"; $visibility = "visible='1'";
} }
$query = $db->simple_select("posts", "COUNT(pid) AS post_count", "tid='{$tid}' AND {$visibility}"); $query = $db->simple_select("posts", "COUNT(pid) AS post_count", "tid='{$tid}' AND {$visibility}");
$numposts = $db->fetch_field($query, "post_count"); $numposts = $db->fetch_field($query, "post_count");
 End of changes. 4 change blocks. 
3 lines changed or deleted 19 lines changed or added

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