Index: trunk/phase3/includes/specials/SpecialBlock.php |
— | — | @@ -346,12 +346,10 @@ |
347 | 347 | protected function doPostText( HTMLForm &$form ){ |
348 | 348 | global $wgUser, $wgLang; |
349 | 349 | |
350 | | - $skin = $wgUser->getSkin(); |
351 | | - |
352 | 350 | # Link to the user's contributions, if applicable |
353 | 351 | if( $this->target instanceof User ){ |
354 | 352 | $contribsPage = SpecialPage::getTitleFor( 'Contributions', $this->target->getName() ); |
355 | | - $links[] = $skin->link( |
| 353 | + $links[] = Linker::link( |
356 | 354 | $contribsPage, |
357 | 355 | wfMsgExt( 'ipb-blocklist-contribs', 'escape', $this->target->getName() ) |
358 | 356 | ); |
— | — | @@ -365,17 +363,17 @@ |
366 | 364 | $message = wfMsgExt( 'ipb-unblock', array( 'parseinline' ) ); |
367 | 365 | $list = SpecialPage::getTitleFor( 'Unblock' ); |
368 | 366 | } |
369 | | - $links[] = $skin->linkKnown( $list, $message, array() ); |
| 367 | + $links[] = Linker::linkKnown( $list, $message, array() ); |
370 | 368 | |
371 | 369 | # Link to the block list |
372 | | - $links[] = $skin->linkKnown( |
| 370 | + $links[] = Linker::linkKnown( |
373 | 371 | SpecialPage::getTitleFor( 'BlockList' ), |
374 | 372 | wfMsg( 'ipb-blocklist' ) |
375 | 373 | ); |
376 | 374 | |
377 | 375 | # Link to edit the block dropdown reasons, if applicable |
378 | 376 | if ( $wgUser->isAllowed( 'editinterface' ) ) { |
379 | | - $links[] = $skin->link( |
| 377 | + $links[] = Linker::link( |
380 | 378 | Title::makeTitle( NS_MEDIAWIKI, 'Ipbreason-dropdown' ), |
381 | 379 | wfMsgHtml( 'ipb-edit-dropdown' ), |
382 | 380 | array(), |
— | — | @@ -476,6 +474,8 @@ |
477 | 475 | /** |
478 | 476 | * HTMLForm field validation-callback for Target field. |
479 | 477 | * @since 1.18 |
| 478 | + * @param $value String |
| 479 | + * @param $alldata Array |
480 | 480 | * @return Message |
481 | 481 | */ |
482 | 482 | public static function validateTargetField( $value, $alldata = null ) { |
— | — | @@ -636,7 +636,7 @@ |
637 | 637 | if( !$status ) { |
638 | 638 | # Show form unless the user is already aware of this... |
639 | 639 | if( !$data['Confirm'] || ( array_key_exists( 'PreviousTarget', $data ) |
640 | | - && $data['PreviousTarget'] !== htmlspecialchars( $block->getTarget() ) ) ) |
| 640 | + && $data['PreviousTarget'] !== $block->getTarget() ) ) |
641 | 641 | { |
642 | 642 | return array( array( 'ipb_already_blocked', $block->getTarget() ) ); |
643 | 643 | # Otherwise, try to update the block... |
— | — | @@ -715,6 +715,8 @@ |
716 | 716 | * Get an array of suggested block durations from MediaWiki:Ipboptions |
717 | 717 | * @todo FIXME: This uses a rather odd syntax for the options, should it be converted |
718 | 718 | * to the standard "**<duration>|<displayname>" format? |
| 719 | + * @param $lang Language|null the language to get the durations in, or null to use |
| 720 | + * the wiki's content language |
719 | 721 | * @return Array |
720 | 722 | */ |
721 | 723 | public static function getSuggestedDurations( $lang = null ){ |
— | — | @@ -775,6 +777,7 @@ |
776 | 778 | * others, and probably shouldn't be able to unblock themselves |
777 | 779 | * either. |
778 | 780 | * @param $user User|Int|String |
| 781 | + * @return Bool|String true or error message key |
779 | 782 | */ |
780 | 783 | public static function checkUnblockSelf( $user ) { |
781 | 784 | global $wgUser; |
— | — | @@ -788,6 +791,9 @@ |
789 | 792 | # User is trying to unblock themselves |
790 | 793 | if ( $wgUser->isAllowed( 'unblockself' ) ) { |
791 | 794 | return true; |
| 795 | + # User blocked themselves and is now trying to reverse it |
| 796 | + } elseif ( $wgUser->blockedBy() === $wgUser->getName() ) { |
| 797 | + return true; |
792 | 798 | } else { |
793 | 799 | return 'ipbnounblockself'; |
794 | 800 | } |