[buddypress-trac] [BuddyPress Trac] #9172: bp_user_has_opted_out() should return false if no email address is provided.

buddypress-trac noreply at wordpress.org
Wed Jun 5 21:12:45 UTC 2024


#9172: bp_user_has_opted_out() should return false if no email address is
provided.
--------------------------+-----------------------
 Reporter:  dcavins       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  14.0.0
Component:  Emails        |    Version:  12.5.0
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------
 `bp_user_has_opted_out()` uses `BP_Optout::optout_exists()` internally,
 but if no `where` parameters are provided, `BP_Optout::get()` returns
 every optout, as you might expect.

 This is weird behavior for `bp_user_has_opted_out()`, though (and for
 optout_exists, truthfully). We prevent this issue in `bp_add_optout()` by
 ensuring that the email address parameter is not empty, so we could add a
 similar check in `bp_user_has_opted_out()`.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9172>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list