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-actions.php

    r7207 r7350  
    4343
    4444        $reset_steps = true;
    45         bp_core_redirect( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . array_shift( array_keys( $bp->groups->group_creation_steps ) ) . '/' );
     45        $step        = array_keys( $bp->groups->group_creation_steps );
     46        $redirect_to = bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . $step[0] . '/';
     47        bp_core_redirect( $redirect_to );
    4648    }
    4749
     
    134136        // If we have completed all steps and hit done on the final step we
    135137        // can redirect to the completed group
    136         if ( count( $bp->groups->completed_create_steps ) == count( $bp->groups->group_creation_steps ) && bp_get_groups_current_create_step() == array_pop( array_keys( $bp->groups->group_creation_steps ) ) ) {
     138        $keys = array_keys( $bp->groups->group_creation_steps );
     139        if ( count( $bp->groups->completed_create_steps ) == count( $keys ) && bp_get_groups_current_create_step() == array_pop( $keys ) ) {
    137140            unset( $bp->groups->current_create_step );
    138141            unset( $bp->groups->completed_create_steps );
     
    153156             * we need to loop the step array and fetch the next step that way.
    154157             */
    155             foreach ( (array) $bp->groups->group_creation_steps as $key => $value ) {
     158            foreach ( $keys as $key ) {
    156159                if ( $key == bp_get_groups_current_create_step() ) {
    157160                    $next = 1;
Note: See TracChangeset for help on using the changeset viewer.