From: Niklas Laxström Date: Mon, 24 May 2010 09:55:46 +0000 (+0000) Subject: Make getUserPermissionsErrors(Expensive) actually handle $result as documented X-Git-Tag: 1.31.0-rc.0~36754 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=198f6b010a1a25827687942fb70bf4262c065024;p=lhc%2Fweb%2Fwiklou.git Make getUserPermissionsErrors(Expensive) actually handle $result as documented Fatal errors was caused by nesting the results one level too deep --- diff --git a/includes/Title.php b/includes/Title.php index ff4a213063..8bdc1833ff 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1272,12 +1272,12 @@ class Title { } // Check getUserPermissionsErrors hook if ( !wfRunHooks( 'getUserPermissionsErrors', array( &$this, &$user, $action, &$result ) ) ) { - $errors[] = $this->resultToError( $errors, $result ); + $errors = $this->resultToError( $errors, $result ); } // Check getUserPermissionsErrorsExpensive hook if ( $doExpensiveQueries && !( $short && count( $errors ) > 0 ) && !wfRunHooks( 'getUserPermissionsErrorsExpensive', array( &$this, &$user, $action, &$result ) ) ) { - $errors[] = $this->resultToError( $errors, $result ); + $errors = $this->resultToError( $errors, $result ); } return $errors;