From: Timo Tijhof Date: Fri, 29 Mar 2019 18:41:56 +0000 (+0000) Subject: auth: Make 'LocalUserCreated' hook non-abortable X-Git-Tag: 1.34.0-rc.0~2223^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=ef3b8bf08bd75b136f4a6774856cecd1dc9a2d91;p=lhc%2Fweb%2Fwiklou.git auth: Make 'LocalUserCreated' hook non-abortable Its return value was already not used. By using runWithoutAbort() it means that if a hook accidentally returns false, it will throw an exception instead of silently skipping other hook handlers. This type of mistake has repeatedly caused problems in WMF prod over the years. Change-Id: I6af2261957eb20f18fa5f0d50c4c4835d3850cfe --- diff --git a/includes/auth/AuthManager.php b/includes/auth/AuthManager.php index 0c6218e6d4..bfe278b40a 100644 --- a/includes/auth/AuthManager.php +++ b/includes/auth/AuthManager.php @@ -1423,7 +1423,7 @@ class AuthManager implements LoggerAwareInterface { // @codeCoverageIgnoreEnd } $this->setDefaultUserOptions( $user, $creator->isAnon() ); - \Hooks::run( 'LocalUserCreated', [ $user, false ] ); + \Hooks::runWithoutAbort( 'LocalUserCreated', [ $user, false ] ); $user->saveSettings(); $state['userid'] = $user->getId();