Index: trunk/phase3/includes/Block.php |
— | — | @@ -969,6 +969,12 @@ |
970 | 970 | * not be the same as the target you gave if you used $vagueTarget! |
971 | 971 | */ |
972 | 972 | public static function newFromTarget( $specificTarget, $vagueTarget = null, $fromMaster = false ) { |
| 973 | + # (bug 29116) passing $vagueTarget = '' is not unreasonable here, but int(0) |
| 974 | + # is a valid username, so we can't just use weak comparisons. |
| 975 | + if( $vagueTarget === '' ){ |
| 976 | + $vagueTarget = null; |
| 977 | + } |
| 978 | + |
973 | 979 | list( $target, $type ) = self::parseTarget( $specificTarget ); |
974 | 980 | if( $type == Block::TYPE_ID || $type == Block::TYPE_AUTO ){ |
975 | 981 | return Block::newFromID( $target ); |