Fix foreach error in player lists

This commit is contained in:
Brian Miyaji
2017-01-13 07:39:15 +11:00
parent d8db3196fd
commit 12b2226817

View File

@@ -326,8 +326,8 @@ class SP_Player_List extends SP_Custom_Post {
$totals[ $player_id ]['eventminutes'] -= sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), 'sub' ), 0, 0 ); $totals[ $player_id ]['eventminutes'] -= sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $player_id ), 'sub' ), 0, 0 );
else: else:
foreach ( $timeline as $timeline_team => $timeline_players ): foreach ( $timeline as $timeline_team => $timeline_players ):
if ( ! is_array( $timeline_players ) ) continue;
foreach ( $timeline_players as $timeline_player => $timeline_performance ): foreach ( $timeline_players as $timeline_player => $timeline_performance ):
if ( ! is_array( $timeline_performance ) ) continue;
if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $player_id === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ): if ( 'sub' === sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'status' ) && $player_id === (int) sp_array_value( sp_array_value( $players, $timeline_player, array() ), 'sub', 0 ) ):
$substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 ); $substitution_time = sp_array_value( sp_array_value( sp_array_value( sp_array_value( $timeline, $team_id ), $timeline_player ), 'sub' ), 0, 0 );
if ( $substitution_time ): if ( $substitution_time ):