From 12b22268179cd7cae037a67a61ba8277ac69438d Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Fri, 13 Jan 2017 07:39:15 +1100 Subject: [PATCH] Fix foreach error in player lists --- includes/class-sp-player-list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-sp-player-list.php b/includes/class-sp-player-list.php index f540be05..adad6b57 100644 --- a/includes/class-sp-player-list.php +++ b/includes/class-sp-player-list.php @@ -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 ); else: foreach ( $timeline as $timeline_team => $timeline_players ): + if ( ! is_array( $timeline_players ) ) continue; 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 ) ): $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 ):