Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -2045,6 +2045,7 @@ |
2046 | 2046 | 'whatlinkshere-filters', |
2047 | 2047 | ), |
2048 | 2048 | 'block' => array( |
| 2049 | + 'autoblockid', |
2049 | 2050 | 'blockip', |
2050 | 2051 | 'blockip-title', |
2051 | 2052 | 'blockip-legend', |
Index: trunk/phase3/includes/Block.php |
— | — | @@ -758,13 +758,17 @@ |
759 | 759 | |
760 | 760 | /** |
761 | 761 | * Get the block name, but with autoblocked IPs hidden as per standard privacy policy |
762 | | - * @return String |
| 762 | + * @return String, text is escaped |
763 | 763 | */ |
764 | 764 | public function getRedactedName() { |
765 | 765 | if ( $this->mAuto ) { |
766 | | - return '#' . $this->mId; |
| 766 | + return HTML::rawElement( |
| 767 | + 'span', |
| 768 | + array( 'class' => 'mw-autoblockid' ), |
| 769 | + wfMessage( 'autoblockid', $this->mId ) |
| 770 | + ); |
767 | 771 | } else { |
768 | | - return $this->mAddress; |
| 772 | + return htmlspecialchars( $this->mAddress ); |
769 | 773 | } |
770 | 774 | } |
771 | 775 | |
— | — | @@ -989,10 +993,20 @@ |
990 | 994 | } |
991 | 995 | |
992 | 996 | /** |
993 | | - * Get the target and target type for this particular Block |
| 997 | + * Get the target and target type for this particular Block. Note that for autoblocks, |
| 998 | + * this returns the unredacted name; frontend functions need to call $block->getRedactedName() |
| 999 | + * in this situation. |
994 | 1000 | * @return array( User|String, Block::TYPE_ constant ) |
| 1001 | + * FIXME: this should be an integral part of the Block member variables |
995 | 1002 | */ |
996 | 1003 | public function getTargetAndType(){ |
997 | | - return self::parseTarget( $this->mAddress ); |
| 1004 | + list( $target, $type ) = self::parseTarget( $this->mAddress ); |
| 1005 | + |
| 1006 | + # Check whether it's an autoblock |
| 1007 | + if( $type == self::TYPE_ID && $this->mAuto ){ |
| 1008 | + $type = self::TYPE_AUTO; |
| 1009 | + } |
| 1010 | + |
| 1011 | + return array( $target, $type ); |
998 | 1012 | } |
999 | 1013 | } |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -3021,6 +3021,7 @@ |
3022 | 3022 | 'whatlinkshere-filters' => 'Filters', |
3023 | 3023 | |
3024 | 3024 | # Block/unblock |
| 3025 | +'autoblockid' => 'Autoblock #$1', |
3025 | 3026 | 'blockip' => 'Block user', |
3026 | 3027 | 'blockip-title' => 'Block user', |
3027 | 3028 | 'blockip-legend' => 'Block user', |