BUG#175 Don't show confusing "* (Lschen) (Aktuell) 23:59, 31. Dez 1969 . . ( Byte...
authorJens Frank <jeluf@users.mediawiki.org>
Sun, 22 Aug 2004 07:38:16 +0000 (07:38 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Sun, 22 Aug 2004 07:38:16 +0000 (07:38 +0000)
if there is no entry in the database

includes/ImagePage.php

index 9f0eab9..fc63c88 100644 (file)
@@ -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 );
        }