http://www.mediawiki.org/wiki/Special:Code/MediaWiki/84524
Revision: 84524
Author: happy-melon
Date: 2011-03-22 11:45:18 +0000 (Tue, 22 Mar 2011)
Log Message:
-----------
Don't try and load a block with no target; we're not going to find it :D
Modified Paths:
--------------
trunk/phase3/includes/Block.php
Modified: trunk/phase3/includes/Block.php
===================================================================
--- trunk/phase3/includes/Block.php 2011-03-22 11:22:15 UTC (rev 84523)
+++ trunk/phase3/includes/Block.php 2011-03-22 11:45:18 UTC (rev 84524)
@@ -1098,6 +1098,10 @@
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 );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs