* (bug 10744) Treat "noarticletext" and "noarticletextanon" as wiki text when used...
authorRob Church <robchurch@users.mediawiki.org>
Wed, 1 Aug 2007 01:23:44 +0000 (01:23 +0000)
committerRob Church <robchurch@users.mediawiki.org>
Wed, 1 Aug 2007 01:23:44 +0000 (01:23 +0000)
* 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
includes/Article.php

index de53d22..16156ae 100644 (file)
@@ -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 ==
 
index 48422f5..086e68c 100644 (file)
@@ -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( '<div class="noarticletext">' );
+                       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( '</div>' );
                } else {
                        $dbr = wfGetDB( DB_SLAVE );
                        $wl_clause = array(