r66819 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66818‎ | r66819 | r66820 >
Date:09:55, 24 May 2010
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Make getUserPermissionsErrors(Expensive) actually handle $result as documented

Fatal errors was caused by nesting the results one level too deep
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -1272,12 +1272,12 @@
12731273 }
12741274 // Check getUserPermissionsErrors hook
12751275 if ( !wfRunHooks( 'getUserPermissionsErrors', array( &$this, &$user, $action, &$result ) ) ) {
1276 - $errors[] = $this->resultToError( $errors, $result );
 1276+ $errors = $this->resultToError( $errors, $result );
12771277 }
12781278 // Check getUserPermissionsErrorsExpensive hook
12791279 if ( $doExpensiveQueries && !( $short && count( $errors ) > 0 ) &&
12801280 !wfRunHooks( 'getUserPermissionsErrorsExpensive', array( &$this, &$user, $action, &$result ) ) ) {
1281 - $errors[] = $this->resultToError( $errors, $result );
 1281+ $errors = $this->resultToError( $errors, $result );
12821282 }
12831283
12841284 return $errors;

Comments

#Comment by Nikerabbit (talk | contribs)   10:15, 24 May 2010

Seems to be introduced in r65504, so REL1_16 is not affected.

Status & tagging log