Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/19/2013 06:26:37 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Fix E_STRICT warnings in group creation code from using functions like array_shift() and array_pop() that expect references rather than results of array_keys(). See #5108.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-template.php

    r7349 r7350  
    22052205        return false;
    22062206
    2207     if ( !bp_get_groups_current_create_step() )
    2208         $bp->groups->current_create_step = array_shift( array_keys( $bp->groups->group_creation_steps ) );
     2207    if ( !bp_get_groups_current_create_step() ) {
     2208        $keys = array_keys( $bp->groups->group_creation_steps );
     2209        $bp->groups->current_create_step = array_shift( $keys );
     2210    }
    22092211
    22102212    $counter = 1;
     
    22342236        global $bp;
    22352237
    2236         if ( !bp_action_variable( 1 ) )
    2237             $bp->action_variables[1] = array_shift( array_keys( $bp->groups->group_creation_steps ) );
     2238        if ( !bp_action_variable( 1 ) ) {
     2239            $keys = array_keys( $bp->groups->group_creation_steps );
     2240            $bp->action_variables[1] = array_shift( $keys );
     2241        }
    22382242
    22392243        return apply_filters( 'bp_get_group_creation_form_action', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_action_variable( 1 ) ) );
     
    22482252
    22492253    /* If this the first step, we can just accept and return true */
    2250     if ( !bp_action_variable( 1 ) && array_shift( array_keys( $bp->groups->group_creation_steps ) ) == $step_slug )
     2254    $keys = array_keys( $bp->groups->group_creation_steps );
     2255    if ( !bp_action_variable( 1 ) && array_shift( $keys ) == $step_slug )
    22512256        return true;
    22522257
     
    22902295
    22912296    /* If this is the first group creation step, return true */
    2292     if ( array_shift( array_keys( $bp->groups->group_creation_steps ) ) == $step_slug )
     2297    $keys = array_keys( $bp->groups->group_creation_steps );
     2298    if ( array_shift( $keys ) == $step_slug )
    22932299        return true;
    22942300
     
    24342440    global $bp;
    24352441
    2436     $last_step = array_pop( array_keys( $bp->groups->group_creation_steps ) );
     2442    $keys      = array_keys( $bp->groups->group_creation_steps );
     2443    $last_step = array_pop( $keys );
    24372444
    24382445    if ( $last_step == bp_get_groups_current_create_step() )
     
    24452452    global $bp;
    24462453
    2447     $first_step = array_shift( array_keys( $bp->groups->group_creation_steps ) );
     2454    $keys       = array_keys( $bp->groups->group_creation_steps );
     2455    $first_step = array_shift( $keys );
    24482456
    24492457    if ( $first_step == bp_get_groups_current_create_step() )
Note: See TracChangeset for help on using the changeset viewer.