Skip to:
Content

BuddyPress.org

Changeset 10016


Ignore:
Timestamp:
07/15/2015 09:35:33 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Core: Yoda condition in bp_is_root_blog() and ensure that $blog_id is an integer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r10012 r10016  
    17601760
    17611761    // Use current blog if no ID is passed
    1762     if ( empty( $blog_id ) ) {
     1762    if ( empty( $blog_id ) || ! is_int( $blog_id ) ) {
    17631763        $blog_id = get_current_blog_id();
    17641764    }
    17651765
    17661766    // Compare to root blog ID
    1767     if ( $blog_id == bp_get_root_blog_id() ) {
     1767    if ( bp_get_root_blog_id() === $blog_id ) {
    17681768        $is_root_blog = true;
    17691769    }
Note: See TracChangeset for help on using the changeset viewer.