From: Happy-melon Date: Tue, 22 Mar 2011 11:45:18 +0000 (+0000) Subject: Don't try and load a block with no target; we're not going to find it :D X-Git-Tag: 1.31.0-rc.0~31254 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=a9016c40ff57baa2ae83f02254bfea0b72b4e0ed;p=lhc%2Fweb%2Fwiklou.git Don't try and load a block with no target; we're not going to find it :D --- diff --git a/includes/Block.php b/includes/Block.php index a112be0f92..af28185fdc 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -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 );