r25377 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25376‎ | r25377 | r25378 >
Date:20:34, 31 August 2007
Author:aaron
Status:old
Tags:
Comment:
*Use addHTML() on formatPermissionsErrorMessage() generated text, otherwise we get ugly escaped HTML links and such.
*Use wfMsgHtml after all, escapes before replacement ;)
Modified paths:
  • /trunk/phase3/includes/OutputPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -847,7 +847,7 @@
848848 $this->enableClientCache( false );
849849 $this->mRedirect = '';
850850 $this->mBodytext = '';
851 - $this->addWikitext( $this->formatPermissionsErrorMessage( $errors ) );
 851+ $this->addHTML( $this->formatPermissionsErrorMessage( $errors ) );
852852 }
853853
854854 /** @deprecated */
@@ -905,12 +905,12 @@
906906 case 0:
907907 case 1:
908908 case 2:
909 - $message = wfMsg( "badaccess-group$n", $groups );
 909+ $message = wfMsgHtml( "badaccess-group$n", $groups );
910910 break;
911911 default:
912 - $message = wfMsg( 'badaccess-groups', $groups );
 912+ $message = wfMsgHtml( 'badaccess-groups', $groups );
913913 }
914 - $this->addHtml( $message );
 914+ #$this->addHtml( $message );
915915 $this->returnToMain( false );
916916 }
917917
@@ -995,6 +995,8 @@
996996 * @todo document
997997 * @param bool $protected Is the reason the page can't be reached because it's protected?
998998 * @param mixed $source
 999+ * @param bool $protected, page is protected?
 1000+ * @param array $reason, array of arrays( msg, args )
9991001 */
10001002 public function readOnlyPage( $source = null, $protected = false, $reasons = array() ) {
10011003 global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle;
@@ -1002,12 +1004,12 @@
10031005
10041006 $this->setRobotpolicy( 'noindex,nofollow' );
10051007 $this->setArticleRelated( false );
1006 -
1007 - if ($reasons != array()) {
 1008+
 1009+ if ( !empty($reasons) ) {
10081010 $this->setPageTitle( wfMsg( 'viewsource' ) );
10091011 $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );
10101012
1011 - $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons ) );
 1013+ $this->addHTML( $this->formatPermissionsErrorMessage( $reasons ) );
10121014 } else if( $protected ) {
10131015 $this->setPageTitle( wfMsg( 'viewsource' ) );
10141016 $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );

Follow-up revisions

RevisionCommit summaryAuthorDate
r25415Merged revisions 25372-25414 via svnmerge from...david21:15, 2 September 2007

Status & tagging log