Defer cookie block checks to resolve a circular dependency
[lhc/web/wiklou.git] / includes / user / User.php
index 3a57c0b..f91f438 100644 (file)
@@ -1346,25 +1346,17 @@ class User implements IDBAccessObject, UserIdentity {
         * @return bool True if the user is logged in, false otherwise.
         */
        private function loadFromSession() {
-               // Deprecated hook
-               $result = null;
-               Hooks::run( 'UserLoadFromSession', [ $this, &$result ], '1.27' );
-               if ( $result !== null ) {
-                       return $result;
-               }
-
                // MediaWiki\Session\Session already did the necessary authentication of the user
                // returned here, so just use it if applicable.
                $session = $this->getRequest()->getSession();
                $user = $session->getUser();
                if ( $user->isLoggedIn() ) {
                        $this->loadFromUserObject( $user );
-                       if ( $user->getBlock() ) {
-                               // If this user is autoblocked, set a cookie to track the block. This has to be done on
-                               // every session load, because an autoblocked editor might not edit again from the same
-                               // IP address after being blocked.
-                               MediaWikiServices::getInstance()->getBlockManager()->trackBlockWithCookie( $this );
-                       }
+
+                       // If this user is autoblocked, set a cookie to track the block. This has to be done on
+                       // every session load, because an autoblocked editor might not edit again from the same
+                       // IP address after being blocked.
+                       MediaWikiServices::getInstance()->getBlockManager()->trackBlockWithCookie( $this );
 
                        // Other code expects these to be set in the session, so set them.
                        $session->set( 'wsUserID', $this->getId() );