From 198f6b010a1a25827687942fb70bf4262c065024 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Mon, 24 May 2010 09:55:46 +0000 Subject: [PATCH] Make getUserPermissionsErrors(Expensive) actually handle $result as documented Fatal errors was caused by nesting the results one level too deep --- includes/Title.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1