From e361fc54f329132ed8b60361e71ce0174cb0a4e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Sun, 3 Jul 2005 13:03:33 +0000 Subject: [PATCH] Check if page actually exists --- RELEASE-NOTES | 2 +- includes/SpecialBooksources.php | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index fe8c138a20..f6610e8148 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/SpecialBooksources.php b/includes/SpecialBooksources.php index bd8596f4db..85a8178448 100644 --- a/includes/SpecialBooksources.php +++ b/includes/SpecialBooksources.php @@ -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. -- 2.20.1