Skip to:

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#1479 closed defect (bug) (fixed)

bb_notify_subscribers incorrectly uses $bb_ksd_pre_post_status

Reported by: otto42's profile Otto42 Owned by:
Milestone: 1.2 Priority: normal
Severity: normal Version: 1.1-alpha
Component: API - Subscriptions Keywords: has-patch
Cc: peter.westwood@…, nightgunner5@…, jkudish


This code is in bb-includes/

function bb_notify_subscribers( $post_id ) {
	global $bbdb, $bb_ksd_pre_post_status;

	if ( !empty( $bb_ksd_pre_post_status ) )
		return false;

The purpose of it checking the $bb_ksd_pre_post_status global here is to prevent it from sending emails notifications when spam posts are made.

The problem is that $bb_ksd_pre_post_status is only used by Akismet internally. So this check is entirely dependent upon Akismet. If you use, say, the bozo plugin, then bozos who make posts will still have their posts emailed out to subscribers.

I think the fix is that the function should just be checking the post_status instead. Since Akismet hooks to pre_post_status to return the value of the $bb_ksd_pre_post_status, this shouldn't be a breaking change.

Attachments (1)

1479-1.diff (653 bytes) - added by jkudish 12 years ago.

Download all attachments as: .zip

Change History (10)

#1 @Otto42
13 years ago

Original ticket that added this: #1233

#2 @westi
13 years ago

  • Cc peter.westwood@… added

#3 @Nightgunner5
13 years ago

  • Cc nightgunner5@… added

#4 @mr_pelle
13 years ago

  • Milestone set to 1.1

#5 @johnjamesjacoby
13 years ago

  • Version changed from 1.0.1 to 1.1-alpha

Moving to 1.1-alpha Version as part of trac triage.

#6 @johnjamesjacoby
13 years ago

  • Milestone changed from 1.1 to 1.2

Moving to 1.2 milestone to release 1.1 for BuddyPress 1.5 compat.

12 years ago

#7 @jkudish
12 years ago

  • Cc jkudish added
  • Keywords has-patch added

In, I've removed the use of the $bb_ksd_pre_post_status global in favor of using the post's post_status to check if the post is spam or coming from a bozo user.

Version 1, edited 12 years ago by jkudish (previous) (next) (diff)

#8 @johnjamesjacoby
12 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [3996]) Notifications (1.1 branch):

  • Check post_status before notifying subscribers, in bb_notify_subscribers().
  • Fixes #1479.
  • Props jkudish.

#9 @johnjamesjacoby
12 years ago

  • Milestone changed from 1.2 to 1.1.1
Note: See TracTickets for help on using tickets.