r88215 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88214‎ | r88215 | r88216 >
Date:05:24, 16 May 2011
Author:vasilievvv
Status:ok
Tags:
Comment:
Properly fix bug 28678, by not allowing to enter the set creation page in
read-only mode.
Modified paths:
  • /trunk/extensions/CentralAuth/specials/SpecialWikiSets.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/specials/SpecialWikiSets.php
@@ -42,6 +42,7 @@
4343 $this->buildMainView();
4444 }
4545 } else {
 46+ $newPage = ( $subpage === '0' && $this->mCanEdit );
4647 if ( $subpage ) {
4748 $set = is_numeric( $subpage ) ? WikiSet::newFromId( $subpage ) : WikiSet::newFromName( $subpage );
4849 if ( $set ) {
@@ -54,9 +55,9 @@
5556 }
5657 }
5758
58 - if ( ( $subpage || $subpage === '0' ) && $this->mCanEdit && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
 59+ if ( ( $subpage || $newPage ) && $this->mCanEdit && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
5960 $this->doSubmit( $subpage );
60 - } else if ( ( $subpage || $subpage === '0' ) && is_numeric( $subpage ) ) {
 61+ } else if ( ( $subpage || $newPage ) && is_numeric( $subpage ) ) {
6162 $this->buildSetView( $subpage );
6263 } else {
6364 $this->buildMainView();
@@ -97,12 +98,6 @@
9899 $wgOut->setSubtitle( wfMsgExt( 'centralauth-editset-subtitle', 'parseinline' ) );
99100
100101 $set = ( $subpage || $subpage === '0' ) ? WikiSet::newFromID( $subpage ) : null;
101 - if( !$set ) {
102 - $wgOut->setPageTitle( wfMsg( 'error' ) );
103 - $error = wfMsgExt( 'centralauth-editset-notfound', array( 'escapenoentities' ), $subpage );
104 - $this->buildMainView( "<strong class='error'>{$error}</strong>" );
105 - return;
106 - }
107102
108103 if ( !$name ) $name = $set ? $set->getName() : '';
109104 if ( !$type ) $type = $set ? $set->getType() : WikiSet::OPTIN;

Follow-up revisions

RevisionCommit summaryAuthorDate
r88825MFT r88215demon19:52, 25 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87404Commit live hack for bug 28678demon15:37, 4 May 2011
r87405Same as r87404, in trunk. Fixes bug 28678: Special:WikiSets/0 explodesdemon15:38, 4 May 2011

Status & tagging log