Skip to content

Commit

Permalink
Commited fix to issue #1558 (http://ocportal.com/tracker/view.php?id=…
Browse files Browse the repository at this point in the history
…1558). [Newbie members could abuse promotion via non-validated forum posts]
  • Loading branch information
World Wide Web Server authored and World Wide Web Server committed Feb 1, 2014
1 parent 5bce3bf commit d1ae01c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sources/ocf_posts_action.php
Expand Up @@ -326,7 +326,7 @@ function ocf_make_post($topic_id,$title,$post,$skip_sig=0,$is_starter=false,$val
if (!is_null($forum_id))
{
$post_counts=is_null($forum_id)?1:$GLOBALS['FORUM_DB']->query_value_null_ok('f_forums','f_post_count_increment',array('id'=>$forum_id));
if (($post_counts===1) && (!$anonymous)) ocf_force_update_member_post_count($poster,1);
if (($post_counts===1) && (!$anonymous) && ($validated==1)) ocf_force_update_member_post_count($poster,1);

if ($check_permissions) ocf_decache_ocp_blocks($forum_id,NULL,$intended_solely_for); // i.e. we don't run this if in installer
}
Expand Down
6 changes: 6 additions & 0 deletions sources/ocf_posts_action3.php
Expand Up @@ -60,6 +60,12 @@ function ocf_validate_post($post_id,$topic_id=NULL,$forum_id=NULL,$poster=NULL,$
$_url=build_url(array('page'=>'topicview','id'=>$topic_id),'forum',NULL,false,false,true,'post_'.strval($post_id));
$url=$_url->evaluate();

if (!is_null($forum_id))
{
$post_counts=$GLOBALS['FORUM_DB']->query_value_null_ok('f_forums','f_post_count_increment',array('id'=>$forum_id));
if ($post_counts===1) ocf_force_update_member_post_count($poster,1);
}

ocf_send_topic_notification($url,$topic_id,$forum_id,$poster,$is_starter,$post,$topic_info[0]['t_cache_first_title'],NULL,!is_null($topic_info[0]['t_pt_from']));

if (!is_null($forum_id))
Expand Down

0 comments on commit d1ae01c

Please sign in to comment.