From 526865616af2caab5f55f0ac6aa1a74345192d43 Mon Sep 17 00:00:00 2001 From: Rob Church Date: Wed, 1 Aug 2007 01:23:44 +0000 Subject: [PATCH] * (bug 10744) Treat "noarticletext" and "noarticletextanon" as wiki text when used on a non-existent page with "action=info" * Fix escaping of raw message text when used on a non-existent page with "action=info" This should be shunted off to the API. We could add some appropriate HTTP response codes, at least... --- RELEASE-NOTES | 4 ++++ includes/Article.php | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index de53d220fd..16156aebf3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -334,6 +334,10 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Fixed leading zero in base 36 SHA-1 hash * Protection form no longer produces JavaScript errors * (bug 10741) File histories show "delete" links for non-sysops +* (bug 10744) Treat "noarticletext" and "noarticletextanon" as wiki text when + used on a non-existent page with "action=info" +* Fix escaping of raw message text when used on a non-existent page with + "action=info" == API changes since 1.10 == diff --git a/includes/Article.php b/includes/Article.php index 48422f558a..086e68cdb0 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -2804,16 +2804,21 @@ class Article { $wgOut->setPagetitle( $page->getPrefixedText() ); $wgOut->setPageTitleActionText( wfMsg( 'info_short' ) ); - $wgOut->setSubtitle( wfMsg( 'infosubtitle' )); - - # first, see if the page exists at all. - $exists = $page->getArticleId() != 0; - if( !$exists ) { - if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { - $wgOut->addHTML(wfMsgWeirdKey ( $this->mTitle->getText() ) ); + $wgOut->setSubtitle( wfMsg( 'infosubtitle' ) ); + + if( !$this->mTitle->exists() ) { + $wgOut->addHtml( '
' ); + if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) { + // This doesn't quite make sense; the user is asking for + // information about the _page_, not the message... -- RC + $wgOut->addHtml( htmlspecialchars( wfMsgWeirdKey( $this->mTitle->getText() ) ) ); } else { - $wgOut->addHTML(wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) ); + $msg = $wgUser->isLoggedIn() + ? 'noarticletext' + : 'noarticletextanon'; + $wgOut->addHtml( wfMsgExt( $msg, 'parse' ) ); } + $wgOut->addHtml( '
' ); } else { $dbr = wfGetDB( DB_SLAVE ); $wl_clause = array( -- 2.20.1