From: Aaron Schulz Date: Fri, 31 Aug 2007 20:34:41 +0000 (+0000) Subject: *Use addHTML() on formatPermissionsErrorMessage() generated text, otherwise we get... X-Git-Tag: 1.31.0-rc.0~51571 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=3bebcb6e9b4a1fd8d7e947bfe3d8c876b57981e0;p=lhc%2Fweb%2Fwiklou.git *Use addHTML() on formatPermissionsErrorMessage() generated text, otherwise we get ugly escaped HTML links and such. *Use wfMsgHtml after all, escapes before replacement ;) --- diff --git a/includes/OutputPage.php b/includes/OutputPage.php index a12d175eff..fc2868babf 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -847,7 +847,7 @@ class OutputPage { $this->enableClientCache( false ); $this->mRedirect = ''; $this->mBodytext = ''; - $this->addWikitext( $this->formatPermissionsErrorMessage( $errors ) ); + $this->addHTML( $this->formatPermissionsErrorMessage( $errors ) ); } /** @deprecated */ @@ -905,12 +905,12 @@ class OutputPage { case 0: case 1: case 2: - $message = wfMsg( "badaccess-group$n", $groups ); + $message = wfMsgHtml( "badaccess-group$n", $groups ); break; default: - $message = wfMsg( 'badaccess-groups', $groups ); + $message = wfMsgHtml( 'badaccess-groups', $groups ); } - $this->addHtml( $message ); + #$this->addHtml( $message ); $this->returnToMain( false ); } @@ -995,6 +995,8 @@ class OutputPage { * @todo document * @param bool $protected Is the reason the page can't be reached because it's protected? * @param mixed $source + * @param bool $protected, page is protected? + * @param array $reason, array of arrays( msg, args ) */ public function readOnlyPage( $source = null, $protected = false, $reasons = array() ) { global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle; @@ -1002,12 +1004,12 @@ class OutputPage { $this->setRobotpolicy( 'noindex,nofollow' ); $this->setArticleRelated( false ); - - if ($reasons != array()) { + + if ( !empty($reasons) ) { $this->setPageTitle( wfMsg( 'viewsource' ) ); $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) ); - $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons ) ); + $this->addHTML( $this->formatPermissionsErrorMessage( $reasons ) ); } else if( $protected ) { $this->setPageTitle( wfMsg( 'viewsource' ) ); $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) );