https://bugzilla.wikimedia.org/show_bug.cgi?id=29116

--- Comment #8 from Brion Vibber <br...@wikimedia.org> 2011-05-24 00:10:12 UTC 
---
So this seems to fail because r84475 makes new assumptions about input data:
the $vagueTarget parameter given to Block::newLoad is '', which is !== null and
therefore gets divided up for further processing.

This expands through self::parseTarget() to a ($target, $type) of (null, null),
which results in the exception being thrown.


$vagueTarget here is... the second parameter passed to Block::newFromTarget().
Callers expect to pass empty strings as empty here, but the code now requires
null:


CheckUser_body.php:

    # Check if this user or IP is blocked. If so, give a link to the block
log...
    $ip = IP::isIPAddress( $name ) ? $name : '';
    $flags = $this->userBlockFlags( $ip, $users_ids[$name], $user );
...
    $block = Block::newFromTarget( $user, $ip, false );
...

Block.php:
    if( $block->newLoad( $vagueTarget ) ){
...
    if( $vagueTarget !== null ){
        list( $target, $type ) = self::parseTarget( $vagueTarget );
        switch( $type ) {
...
        default:
            throw new MWException( "Tried to load block with invalid type" );

Block::newLoad and friends should probably be fixed to accept empty string
values as empty, as existing callers expect.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to