Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 10 years ago

#7042 closed defect (bug) (wontfix)

bp_send_email function not working with numeric string for $to argument

Reported by: WeddyWood Owned by:
Priority: normal Milestone:
Component: Emails Version: 2.5.0
Severity: normal Keywords:
Cc:

Description

For example: bp_send_email('email_type','4747',[]) not working with numeric user id.

This not working because is_int( $email_or_user ) used instead of is_numeric().

__construct method of BP_Email_Recipient class uses get_user_by WP function which uses get_data_by with is_numeric() function for 'id'

Therefore, for consistency of behavior need to use is_numeric().

Change History (4)

#1 @DJPaul
11 years ago

  • Milestone Awaiting Review → Under Consideration

Hi @WeddyWood, thanks for starting a discussion. The BuddyPress Emails API is designed to be strictly-typed on purpose, and making this change would weaken that architectural decision. This is not a change we will make, unless...

how are you passing numeric strings to bp_send_email()? Is this in custom code, or have you filtered something that causes this to break?

This ticket was mentioned in ​Slack in #buddypress by dcavins. ​View the logs.


11 years ago

#3 @DJPaul
10 years ago

  • Milestone Under Consideration → Awaiting Review

#4 @DJPaul
10 years ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → closed

This report has had no follow-up from the original reporter, and I don't like the suggestion, so I'm closing it.

Note: See TracTickets for help on using tickets.