Skip to:
Content

BuddyPress.org

Changeset 11585


Ignore:
Timestamp:
06/09/2017 08:40:13 PM (8 years ago)
Author:
r-a-y
Message:

Improve type casting when building button classes.

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

See #7392.

Backports r11521 to 2.8-branch.

File:
1 edited

Legend:

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

    r11187 r11585  
    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.