Skip to:
Content

BuddyPress.org

Changeset 11521


Ignore:
Timestamp:
03/30/2017 07:12:48 PM (3 years ago)
Author:
boonebgorges
Message:

Improve type casting when building button classes.

A failure to enforce the array caused a fatal error in PHP 7.1+.

See #7392.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-button.php

    r11187 r11521  
    294294            // Always add 'generic-button' class.
    295295            if ( false === strpos( $r['parent_attr']['class'], 'generic-button' ) ) {
     296                if ( ! is_array( $r['parent_attr'] ) ) {
     297                    $r['parent_attr'] = array();
     298                }
    296299                if ( ! empty( $r['parent_attr']['class'] ) ) {
    297300                    $r['parent_attr']['class'] .= ' ';
Note: See TracChangeset for help on using the changeset viewer.