Skip to:
Content

BuddyPress.org

Ticket #8726: 8726.patch

File 8726.patch, 2.3 KB (added by imath, 3 years ago)
  • src/bp-core/bp-core-avatars.php

    diff --git src/bp-core/bp-core-avatars.php src/bp-core/bp-core-avatars.php
    index 8f264f607..18f9040ea 100644
    function bp_core_fetch_avatar( $args = '' ) { 
    456456
    457457        // Use an alias to leave the param unchanged.
    458458        $avatar_classes = $params['class'];
    459         if ( ! is_array( $avatar_classes ) ) {
     459        if ( is_null( $avatar_classes ) ) {
     460                $avatar_classes = array();
     461        } elseif ( ! is_array( $avatar_classes ) ) {
    460462                $avatar_classes = explode( ' ', $avatar_classes );
    461463        }
    462464
  • src/bp-core/classes/class-bp-core-bp-nav-backcompat.php

    diff --git src/bp-core/classes/class-bp-core-bp-nav-backcompat.php src/bp-core/classes/class-bp-core-bp-nav-backcompat.php
    index cf9c2b4df..ff9e874d3 100644
    class BP_Core_BP_Nav_BackCompat implements ArrayAccess { 
    6060         * @param mixed $offset Array offset.
    6161         * @param array $value  Nav item.
    6262         */
     63        #[ReturnTypeWillChange]
    6364        public function offsetSet( $offset, $value ) {
    6465                _doing_it_wrong(
    6566                        'bp_nav',
    class BP_Core_BP_Nav_BackCompat implements ArrayAccess { 
    9495         * @param mixed $offset Array offset.
    9596         * @return BP_Core_BP_Nav_BackCompat
    9697         */
     98        #[ReturnTypeWillChange]
    9799        public function offsetGet( $offset ) {
    98100                _doing_it_wrong(
    99101                        'bp_nav',
    class BP_Core_BP_Nav_BackCompat implements ArrayAccess { 
    101103                        '2.6.0'
    102104                );
    103105
    104 //              if ( ! isset( $this->backcompat_nav[ $offset ] ) ) {
    105                         $nav = $this->get_nav( $offset );
    106                         if ( $nav && isset( $nav[ $offset ] ) ) {
    107                                 $this->backcompat_nav[ $offset ] = new self( $nav[ $offset ] );
    108                         }
    109 //              }
     106                $nav = $this->get_nav( $offset );
     107                if ( $nav && isset( $nav[ $offset ] ) ) {
     108                        $this->backcompat_nav[ $offset ] = new self( $nav[ $offset ] );
     109                }
    110110
    111111                return $this->backcompat_nav[ $offset ];
    112112        }
    class BP_Core_BP_Nav_BackCompat implements ArrayAccess { 
    119119         * @param mixed $offset Array offset.
    120120         * @return bool
    121121         */
     122        #[ReturnTypeWillChange]
    122123        public function offsetExists( $offset ) {
    123124                _doing_it_wrong(
    124125                        'bp_nav',
    class BP_Core_BP_Nav_BackCompat implements ArrayAccess { 
    145146         *
    146147         * @param mixed $offset Array offset.
    147148         */
     149        #[ReturnTypeWillChange]
    148150        public function offsetUnset( $offset ) {
    149151                _doing_it_wrong(
    150152                        'bp_nav',