Sometimes the full string isn't represented, leading to invalid
index access on list()
Just default to 0 since it makes sense here
Change-Id: Icd06d2b22b1fcb57a8849ef6dc8659b424f27fdc
public function preprocessResults( $dbr, $res ) {
$this->totalCount = $this->totalBytes = 0;
foreach ( $res as $row ) {
- list( , , $count, $bytes ) = $this->splitFakeTitle( $row->title );
- $this->totalCount += $count;
- $this->totalBytes += $bytes;
+ $mediaStats = $this->splitFakeTitle( $row->title );
+ $this->totalCount += isset( $mediaStats[2] ) ? $mediaStats[2] : 0;
+ $this->totalBytes += isset( $mediaStats[3] ) ? $mediaStats[3] : 0;
}
$res->seek( 0 );
}