From: aude Date: Wed, 4 May 2016 14:47:03 +0000 (-0400) Subject: If $line is empty in EnhancedChangesList, don't try to access parts of array X-Git-Tag: 1.31.0-rc.0~7106 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=4ae160aac7323bdab486933d187252c224ec10c0;p=lhc%2Fweb%2Fwiklou.git If $line is empty in EnhancedChangesList, don't try to access parts of array In getLineData, if the EnhancedChangesListModifyLineData hook returns false, then $line is an empty array and recentChangesFlagsRaw is not set. If $line is empty then presumably we don't want to render it and can skip the line here. Bug: T133296 Change-Id: I92fded07274a06a0dd2929b97815bfe56f1847ea --- diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index a808516162..1070877c5d 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -262,6 +262,7 @@ class EnhancedChangesList extends ChangesList { if ( !$line ) { // completely ignore this RC entry if we don't want to render it unset( $block[$i] ); + continue; } // Roll up flags @@ -286,6 +287,7 @@ class EnhancedChangesList extends ChangesList { $lines[] = $line; } + // Further down are some assumptions that $block is a 0-indexed array // with (count-1) as last key. Let's make sure it is. $block = array_values( $block );