Skip to:
Content

BuddyPress.org

Changeset 4593


Ignore:
Timestamp:
07/04/2011 07:01:52 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Add checks for empty $user_id param in is_spam and is_deleted user functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-functions.php

    r4592 r4593  
    476476 *
    477477 * @package BuddyPress Core
    478  * @param $user_id int The id for the user.
    479  * @return int 1 if spammer, 0 if not.
    480  */
    481 function bp_core_is_user_spammer( $user_id ) {
     478 * @param int $user_id int The id for the user.
     479 * @return bool 1 if spammer, 0 if not.
     480 */
     481function bp_core_is_user_spammer( $user_id = 0 ) {
    482482    global $wpdb;
     483
     484    // No user to check
     485    if ( empty( $user_id ) )
     486        return false;
    483487
    484488    // Assume user is not spam
     
    510514 *
    511515 * @package BuddyPress Core
    512  * @param $user_id int The id for the user.
    513  * @return int 1 if deleted, 0 if not.
    514  */
    515 function bp_core_is_user_deleted( $user_id ) {
     516 * @param int $user_id int The id for the user.
     517 * @return bool 1 if deleted, 0 if not.
     518 */
     519function bp_core_is_user_deleted( $user_id = 0 ) {
    516520    global $wpdb;
     521
     522    // No user to check
     523    if ( empty( $user_id ) )
     524        return false;
    517525
    518526    // Assume user is not deleted
Note: See TracChangeset for help on using the changeset viewer.