PHP function "empty" bugged?
Posted: November 29th, 2013, 10:56 pm
We're using BuddyPress and experiencing problems. When diving into the code I discovered this:
The var_dump calls are mine. When $bp->groups->current_create_step is non-empty the else branch is still executed and $current_create_step results as a blank string.
- Code: Select all
function bp_get_groups_current_create_step() {
global $bp;
var_dump($bp->groups->current_create_step);
if ( !empty( $bp->groups->current_create_step ) ) {
var_dump("assigning value");
$current_create_step = $bp->groups->current_create_step;
} else {
var_dump("assigning blank");
$current_create_step = '';
}
var_dump($current_create_step);
return apply_filters( 'bp_get_groups_current_create_step', $current_create_step );
}
The var_dump calls are mine. When $bp->groups->current_create_step is non-empty the else branch is still executed and $current_create_step results as a blank string.