From e9aba9f2eabb046ad3c10a7a618ab62ce758d9de Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 7 Mar 2006 04:23:09 +0000 Subject: [PATCH] * (bug 5161) Don't try to load template list for nonexistent pages --- RELEASE-NOTES | 1 + includes/Article.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d25dcacbfc..7f6f843a82 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -679,6 +679,7 @@ fully support the editing toolbar, but was found to be too confusing. * (bug 5152) Proper HTML escaping on subpage breadcrumbs * (bug 4855) Section edit links now have the section name in the title attribute. * (bug 2115) Support shift-selecting multiple checkboxes with JavaScript. +* (bug 5161) Don't try to load template list for nonexistent pages === Caveats === diff --git a/includes/Article.php b/includes/Article.php index 9fd25e3de8..35aacef185 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2625,6 +2625,9 @@ class Article { function getUsedTemplates() { $result = array(); $id = $this->mTitle->getArticleID(); + if( $id == 0 ) { + return array(); + } $dbr =& wfGetDB( DB_SLAVE ); $res = $dbr->select( array( 'templatelinks' ), -- 2.20.1