r103822 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103821‎ | r103822 | r103823 >
Date:16:54, 21 November 2011
Author:robin
Status:ok (Comments)
Tags:
Comment:
simplify code, 'createpage' requires 'edit' right anyway
Modified paths:
  • /trunk/extensions/WikimediaIncubator/IncubatorTest.php (modified) (history)

Diff [purge]

Index: trunk/extensions/WikimediaIncubator/IncubatorTest.php
@@ -309,8 +309,6 @@
310310 * @return Boolean
311311 */
312312 static function onGetUserPermissionsErrors( $title, $user, $action, &$result ) {
313 - $notAllowedActions = in_array( $action, array( 'edit', 'createpage' ) );
314 -
315313 $titletext = $title->getText();
316314 $prefixdata = self::analyzePrefix( $titletext );
317315
@@ -327,7 +325,7 @@
328326 # faking external link to support prot-rel URLs
329327 $link = "[$link ". self::makeExternalLinkText( $link ) . "]";
330328 $result[] = array( 'wminc-error-wiki-exists', $link );
331 - return $notAllowedActions ? false : true;
 329+ return $action != 'edit';
332330 }
333331
334332 if( !self::shouldWeShowUnprefixedError( $title ) || $action != 'create' ) {
@@ -346,7 +344,7 @@
347345 $error = 'wminc-error-unprefixed';
348346 }
349347 $result = $error;
350 - return $notAllowedActions ? false : true;
 348+ return $action != 'edit';
351349 }
352350
353351 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r105776MFT for WikimediaIncubator: r95582, r96122, r96138, r96141, r97175, r98670, r...siebrand00:32, 11 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103637Apparently behaviour changed in trunk, so blacklisting actions instead of whi...robin04:17, 19 November 2011

Comments

#Comment by Nikerabbit (talk | contribs)   09:30, 8 December 2011

I'd use !== just in case.

Status & tagging log