X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fchanges%2FEnhancedChangesList.php;h=55cb9edd0873ba4bbb6189c12178b5ed7daad822;hp=30c6995008b8c40851c6f12ebd9b5ac12cc2e91a;hb=956c2430c7b8fceb289aaeacc8d6c2e0def2c56e;hpb=dc58db74645913fcdc8019f06c5143e404b4b30c diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index 30c6995008..55cb9edd08 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -102,15 +102,17 @@ class EnhancedChangesList extends ChangesList { $rc->mAttribs['rc_timestamp'], $this->getUser() ); + if ( $this->lastdate === '' ) { + $this->lastdate = $date; + } $ret = ''; - # If it's a new day, add the headline and flush the cache - if ( $date != $this->lastdate ) { - # Process current cache + # If it's a new day, flush the cache and update $this->lastdate + if ( $date !== $this->lastdate ) { + # Process current cache (uses $this->lastdate to generate a heading) $ret = $this->recentChangesBlock(); $this->rc_cache = []; - $ret .= Xml::element( 'h4', null, $date ) . "\n"; $this->lastdate = $date; } @@ -763,7 +765,11 @@ class EnhancedChangesList extends ChangesList { } } - return '
' . $blockOut . '
'; + if ( $blockOut === '' ) { + return ''; + } + // $this->lastdate is kept up to date by recentChangesLine() + return Xml::element( 'h4', null, $this->lastdate ) . "\n
" . $blockOut . '
'; } /**