aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiklas Laxström <nikerabbit@users.mediawiki.org>2005-07-03 13:03:33 +0000
committerNiklas Laxström <nikerabbit@users.mediawiki.org>2005-07-03 13:03:33 +0000
commite361fc54f329132ed8b60361e71ce0174cb0a4e9 (patch)
tree383bde74fe2e6923ac0e887062db3db3ec2d7b8c
parent9b053e433490abba2122ae45ec8d167e6b7526a1 (diff)
downloadmediawikicore-e361fc54f329132ed8b60361e71ce0174cb0a4e9.tar.gz
mediawikicore-e361fc54f329132ed8b60361e71ce0174cb0a4e9.zip
Check if page actually exists
Notes
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/9871
-rw-r--r--RELEASE-NOTES2
-rw-r--r--includes/SpecialBooksources.php13
2 files changed, 8 insertions, 7 deletions
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index fe8c138a2011..f6610e81487b 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 bd8596f4dbc0..85a8178448f7 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.