From 5a3133d4d87a62794ea3be8acd1dc2672bfeebe8 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 29 Jun 2005 00:31:07 +0000 Subject: [PATCH] * Don't show empty-page text in 'Show changes' on new page Changed $noredir on Article::fetchContent() to a more reasonable default. --- RELEASE-NOTES | 1 + includes/Article.php | 6 +++--- includes/EditPage.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4375dbec2c..f6d5635c34 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -413,6 +413,7 @@ Various bugfixes, small features, and a few experimental things: * (bug 2572) Fix edit conflict handling * (bug 2595) Show "Earlier" and "Latest" links on history go to the first/last page in the article history pager. +* Don't show empty-page text in 'Show changes' on new page === Caveats === diff --git a/includes/Article.php b/includes/Article.php index fdefb53db4..e1a5ab01f4 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -325,11 +325,11 @@ class Article { /** * Get text of an article from database * @param int $oldid 0 for whatever the latest revision is - * @param bool $noredir Set to true to avoid following redirects + * @param bool $noredir Set to false to follow redirects * @param bool $globalTitle Set to true to change the global $wgTitle object when following redirects or other unexpected title changes * @return string */ - function fetchContent( $oldid = 0, $noredir = false, $globalTitle = false ) { + function fetchContent( $oldid = 0, $noredir = true, $globalTitle = false ) { if ( $this->mContentLoaded ) { return $this->mContent; } @@ -524,7 +524,7 @@ class Article { function isRedirect( $text = false ) { if ( $text === false ) { $this->loadContent(); - $titleObj = Title::newFromRedirect( $this->fetchContent( false, true ) ); + $titleObj = Title::newFromRedirect( $this->fetchContent() ); } else { $titleObj = Title::newFromRedirect( $text ); } diff --git a/includes/EditPage.php b/includes/EditPage.php index f1594707ad..43d9dc55bc 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1100,7 +1100,7 @@ END */ function getDiff() { require_once( 'DifferenceEngine.php' ); - $oldtext = $this->mArticle->getContent( true ); + $oldtext = $this->mArticle->fetchContent(); $newtext = $this->mArticle->getTextOfLastEditWithSectionReplacedOrAdded( $this->section, $this->textbox1, $this->summary, $this->edittime ); $oldtitle = wfMsg( 'currentrev' ); -- 2.20.1