Make WordPress Core


Ignore:
Timestamp:
10/22/2019 12:09:39 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Plugins: Restore backward compatibility for PHP4-style passing of array( &$this ) as action argument to do_action().

This is a follow-up to [46149] to avoid unnecessary breakage in case of using the old notation.

Props david.binda, jrf.
Reviewed by azaozz.
Fixes #48312.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/plugin.php

    r46451 r46568  
    471471    if ( empty( $arg ) ) {
    472472        $arg[] = '';
     473    } elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
     474        // Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
     475        $arg[0] = $arg[0][0];
    473476    }
    474477
Note: See TracChangeset for help on using the changeset viewer.