Don't try and load a block with no target; we're not going to find it :D
authorHappy-melon <happy-melon@users.mediawiki.org>
Tue, 22 Mar 2011 11:45:18 +0000 (11:45 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Tue, 22 Mar 2011 11:45:18 +0000 (11:45 +0000)
includes/Block.php

index a112be0..af28185 100644 (file)
@@ -1098,6 +1098,10 @@ class Block {
                if( $type == Block::TYPE_ID || $type == Block::TYPE_AUTO ){
                        return Block::newFromID( $target );
 
+               } elseif( $target === null && $vagueTarget === null ){
+                       # We're not going to find anything useful here
+                       return null;
+
                } elseif( in_array( $type, array( Block::TYPE_USER, Block::TYPE_IP, Block::TYPE_RANGE, null ) ) ) {
                        $block = new Block();
                        $block->fromMaster( $fromMaster );