Skip to:
Content

bbPress.org

Changeset 6205


Ignore:
Timestamp:
01/03/2017 07:25:44 PM (6 years ago)
Author:
xknown
Message:

branch 1.1: Fix PHP 7 compat issues w.r.t. the use of func_get_arg().

func_get_arg() returns the current (modified) value of the given argument. Let's make sure the code behaves the same.
See #3033

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/bb-includes/functions.bb-deprecated.php

    r6153 r6205  
    469469    bb_log_deprecated('function', __FUNCTION__, 'bb_tag_heat_map (with variations to arguments)');
    470470    $defaults = array( 'smallest' => 8, 'largest' => 22, 'unit' => 'pt', 'limit' => 45, 'format' => 'flat' );
     471    $_args = func_get_args();
    471472    $args = wp_parse_args( $args, $defaults );
    472473
    473474    if ( 1 < $fn = func_num_args() ) : // For back compat
    474         $args['smallest'] = func_get_arg(0);
    475         $args['largest']  = func_get_arg(1);
    476         $args['unit']     = 2 < $fn ? func_get_arg(2) : $unit;
    477         $args['limit']    = 3 < $fn ? func_get_arg(3) : $limit;
     475        $args['smallest'] = $_args[0];
     476        $args['largest']  = $_args[1];
     477        $args['unit']     = 2 < $fn ? $_args[2] : $unit;
     478        $args['limit']    = 3 < $fn ? $_args[3] : $limit;
    478479    endif;
    479480
Note: See TracChangeset for help on using the changeset viewer.