Use UserIdentity::isRegistered instead of User::isAnon in BlockManager
authorThalia <thalia.e.chan@googlemail.com>
Mon, 26 Aug 2019 23:21:04 +0000 (00:21 +0100)
committerThalia <thalia.e.chan@googlemail.com>
Tue, 27 Aug 2019 06:23:58 +0000 (07:23 +0100)
BlockManager::getBlockFromCookieValue accepts a UserIdentity, so should
only call methods defined in that interface.

Change-Id: If30df15b800cceee0ad052a2e0524df8b28d9901

includes/block/BlockManager.php

index 948ed93..83b59c7 100644 (file)
@@ -257,7 +257,7 @@ class BlockManager {
                        $block = DatabaseBlock::newFromID( $blockCookieId );
                        if (
                                $block instanceof DatabaseBlock &&
-                               $this->shouldApplyCookieBlock( $block, $user->isAnon() )
+                               $this->shouldApplyCookieBlock( $block, !$user->isRegistered() )
                        ) {
                                return $block;
                        }