Index: trunk/phase3/includes/Block.php |
— | — | @@ -933,6 +933,9 @@ |
934 | 934 | |
935 | 935 | $userObj = User::newFromName( $target ); |
936 | 936 | if( $userObj instanceof User ){ |
| 937 | + # Note that since numbers are valid usernames, a $target of "12345" will be |
| 938 | + # considered a User. If you want to pass a block ID, prepend a hash "#12345", |
| 939 | + # since hash characters are not valid in usernames or titles generally. |
937 | 940 | return array( $userObj, Block::TYPE_USER ); |
938 | 941 | |
939 | 942 | } elseif( IP::isValid( $target ) ){ |
— | — | @@ -951,9 +954,9 @@ |
952 | 955 | # Autoblock reference in the form "#12345" |
953 | 956 | return array( substr( $target, 1 ), Block::TYPE_AUTO ); |
954 | 957 | |
955 | | - } elseif( preg_match( '/^\d+$/', $target ) ){ |
956 | | - # Block id reference as a pure number |
957 | | - return array( $target, Block::TYPE_ID ); |
| 958 | + } else { |
| 959 | + # WTF? |
| 960 | + return array( null, null ); |
958 | 961 | } |
959 | 962 | } |
960 | 963 | |