From 2036e1a434cf28011306e259a61976a0afc0e288 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Sun, 22 Aug 2004 07:38:16 +0000 Subject: [PATCH] BUG#175 Don't show confusing "* (Lschen) (Aktuell) 23:59, 31. Dez 1969 . . ( Byte)" line if there is no entry in the database --- includes/ImagePage.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 9f0eab9758..fc63c881a4 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -76,20 +76,22 @@ class ImagePage extends Article { global $wgUser, $wgOut; $sk = $wgUser->getSkin(); - $s = $sk->beginImageHistoryList(); $line = $this->img->nextHistoryLine(); - $s .= $sk->imageHistoryLine( true, $line->img_timestamp, - $this->mTitle->getDBkey(), $line->img_user, - $line->img_user_text, $line->img_size, $line->img_description ); + if ( $line ) { + $s = $sk->beginImageHistoryList() . + $sk->imageHistoryLine( true, $line->img_timestamp, + $this->mTitle->getDBkey(), $line->img_user, + $line->img_user_text, $line->img_size, $line->img_description ); - while ( $line = $this->img->nextHistoryLine() ) { - $s .= $sk->imageHistoryLine( false, $line->img_timestamp, - $line->oi_archive_name, $line->img_user, - $line->img_user_text, $line->img_size, $line->img_description ); - } - $s .= $sk->endImageHistoryList(); + while ( $line = $this->img->nextHistoryLine() ) { + $s .= $sk->imageHistoryLine( false, $line->img_timestamp, + $line->oi_archive_name, $line->img_user, + $line->img_user_text, $line->img_size, $line->img_description ); + } + $s .= $sk->endImageHistoryList(); + } else { $s=""; } $wgOut->addHTML( $s ); } -- 2.20.1