Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/13/2016 09:16:20 AM (8 years ago)
Author:
xknown
Message:

Branch 1.2: 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.2/bb-includes/functions.bb-topic-tags.php

    r3854 r6167  
    355355function get_tagged_topics( $args ) {
    356356    global $tagged_topic_count;
     357    $_args = func_get_args();
    357358    $defaults = array( 'tag_id' => false, 'page' => 1, 'number' => false, 'count' => true );
    358359    if ( is_numeric( $args ) )
     
    361362        $args = wp_parse_args( $args ); // Make sure it's an array
    362363    if ( 1 < func_num_args() )
    363         $args['page'] = func_get_arg(1);
     364        $args['page'] = $_args[1];
    364365    if ( 2 < func_num_args() )
    365         $args['number'] = func_get_arg(2);
     366        $args['number'] = $_args[2];
    366367
    367368    $args = wp_parse_args( $args, $defaults );
     
    377378
    378379function get_tagged_topic_posts( $args ) {
     380    $_args = func_get_args();
    379381    $defaults = array( 'tag_id' => false, 'page' => 1, 'number' => false );
    380382    if ( is_numeric( $args ) )
     
    383385        $args = wp_parse_args( $args ); // Make sure it's an array
    384386    if ( 1 < func_num_args() )
    385         $args['page'] = func_get_arg(1);
     387        $args['page'] = $_args[1];
    386388    if ( 2 < func_num_args() )
    387         $args['number'] = func_get_arg(2);
     389        $args['number'] = $_args[2];
    388390
    389391    $args = wp_parse_args( $args, $defaults );
Note: See TracChangeset for help on using the changeset viewer.