r24504 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24503‎ | r24504 | r24505 >
Date:01:23, 1 August 2007
Author:robchurch
Status:old
Tags:
Comment:
* (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...
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -2804,16 +2804,21 @@
28052805
28062806 $wgOut->setPagetitle( $page->getPrefixedText() );
28072807 $wgOut->setPageTitleActionText( wfMsg( 'info_short' ) );
2808 - $wgOut->setSubtitle( wfMsg( 'infosubtitle' ));
 2808+ $wgOut->setSubtitle( wfMsg( 'infosubtitle' ) );
28092809
2810 - # first, see if the page exists at all.
2811 - $exists = $page->getArticleId() != 0;
2812 - if( !$exists ) {
2813 - if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
2814 - $wgOut->addHTML(wfMsgWeirdKey ( $this->mTitle->getText() ) );
 2810+ if( !$this->mTitle->exists() ) {
 2811+ $wgOut->addHtml( '<div class="noarticletext">' );
 2812+ if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
 2813+ // This doesn't quite make sense; the user is asking for
 2814+ // information about the _page_, not the message... -- RC
 2815+ $wgOut->addHtml( htmlspecialchars( wfMsgWeirdKey( $this->mTitle->getText() ) ) );
28152816 } else {
2816 - $wgOut->addHTML(wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' ) );
 2817+ $msg = $wgUser->isLoggedIn()
 2818+ ? 'noarticletext'
 2819+ : 'noarticletextanon';
 2820+ $wgOut->addHtml( wfMsgExt( $msg, 'parse' ) );
28172821 }
 2822+ $wgOut->addHtml( '</div>' );
28182823 } else {
28192824 $dbr = wfGetDB( DB_SLAVE );
28202825 $wl_clause = array(
Index: trunk/phase3/RELEASE-NOTES
@@ -334,6 +334,10 @@
335335 * Fixed leading zero in base 36 SHA-1 hash
336336 * Protection form no longer produces JavaScript errors
337337 * (bug 10741) File histories show "delete" links for non-sysops
 338+* (bug 10744) Treat "noarticletext" and "noarticletextanon" as wiki text when
 339+ used on a non-existent page with "action=info"
 340+* Fix escaping of raw message text when used on a non-existent page with
 341+ "action=info"
338342
339343 == API changes since 1.10 ==
340344

Follow-up revisions

RevisionCommit summaryAuthorDate
r24631Merged revisions 24480-24600 via svnmerge from...david18:39, 6 August 2007

Status & tagging log