auth: Make 'LocalUserCreated' hook non-abortable
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 29 Mar 2019 18:41:56 +0000 (18:41 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 29 Mar 2019 18:41:56 +0000 (18:41 +0000)
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

includes/auth/AuthManager.php

index 0c6218e..bfe278b 100644 (file)
@@ -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();