From 80a30fdb0126b0722c14383548868f263ca4efb6 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 31 Aug 2007 21:33:44 +0000 Subject: [PATCH] *Revert r25375, breaks other messages. I didn't realize how messed up this scheme is. Some messages need to be parsed others need not too. All should be parsed. Any that don't must be changed. *Make getUserPermissionsErrorsInternal() insert wikitext link arguments (e.g. '[[x|y]]', rather than raw links), that way we won't have escaped HTML. --- includes/OutputPage.php | 4 ++-- includes/Title.php | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 834c3938c6..064671571a 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -847,7 +847,7 @@ class OutputPage { $this->enableClientCache( false ); $this->mRedirect = ''; $this->mBodytext = ''; - $this->addHTML( $this->formatPermissionsErrorMessage( $errors ) ); + $this->addWikiText( $this->formatPermissionsErrorMessage( $errors ) ); } /** @deprecated */ @@ -1009,7 +1009,7 @@ class OutputPage { $this->setPageTitle( wfMsg( 'viewsource' ) ); $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) ); - $this->addHTML( $this->formatPermissionsErrorMessage( $reasons ) ); + $this->addWikiText( $this->formatPermissionsErrorMessage( $reasons ) ); } else if( $protected ) { $this->setPageTitle( wfMsg( 'viewsource' ) ); $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) ); diff --git a/includes/Title.php b/includes/Title.php index 80f298c873..0c6d81987a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1178,12 +1178,11 @@ class Title { ( !$this->isTalkPage() && !$user->isAllowed( 'createpage' ) ) ) { $errors[] = $user->isAnon() ? array ('nocreatetext') : array ('nocreate-loggedin'); } - } elseif( $action == 'move' && - !( $this->isMovable() && $user->isAllowed( 'move' ) ) ) { + } elseif( $action == 'move' && !( $this->isMovable() && $user->isAllowed( 'move' ) ) ) { $errors[] = $user->isAnon() ? array ( 'movenologintext' ) : array ('movenotallowed'); - } else if ( !$user->isAllowed( $action ) ) { + } else if ( !$user->isAllowed( $action ) ) { $return = null; - $groups = array(); + $groups = array(); global $wgGroupPermissions; foreach( $wgGroupPermissions as $key => $value ) { if( isset( $value[$action] ) && $value[$action] == true ) { @@ -1191,7 +1190,7 @@ class Title { $groupPage = User::getGroupPage( $key ); if( $groupPage ) { $skin = $user->getSkin(); - $groups[] = $skin->makeLinkObj( $groupPage, $groupName ); + $groups[] = '[['.$groupPage->getPrefixedText().'|'.$groupName.']]'; } else { $groups[] = $groupName; } -- 2.20.1