Check if page actually exists
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Sun, 3 Jul 2005 13:03:33 +0000 (13:03 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Sun, 3 Jul 2005 13:03:33 +0000 (13:03 +0000)
RELEASE-NOTES
includes/SpecialBooksources.php

index fe8c138..f6610e8 100644 (file)
@@ -456,7 +456,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new.
   dynamic date conversion.
 * FiveUpgrade: large table hacks, install iw_trans update before links
 * (bug 2648) Rename namespaces in Afrikaanse
-
+* Special:Booksources checks if custom list page exists before using it
 
 === Caveats ===
 
index bd8596f..85a8178 100644 (file)
@@ -54,12 +54,13 @@ class BookSourceList {
                # [[Wikipedia:Book sources]] or equivalent.
                $bstitle = Title::makeTitleSafe( NS_PROJECT, wfMsg( "booksources" ) );
                $bsarticle = new Article( $bstitle );
-               $bstext = $bsarticle->getContent( false );
-
-               if( $bstext ) { 
-                       $bstext = str_replace( "MAGICNUMBER", $this->mIsbn, $bstext );
-                       $wgOut->addWikiText( $bstext );
-                       return;
+               if( $bsarticle->exists() ) {
+                       $bstext = $bsarticle->getContent( false );
+                       if( $bstext ) { 
+                               $bstext = str_replace( "MAGICNUMBER", $this->mIsbn, $bstext );
+                               $wgOut->addWikiText( $bstext );
+                               return;
+                       }
                }
                
                # Otherwise, use the list of links in the default Language.php file.