Merge "UserTest: Cover User::isIP and User::isValidUserName better"
[lhc/web/wiklou.git] / includes / specials / SpecialDeletedContributions.php
index 3115215..4df5b2b 100644 (file)
@@ -147,7 +147,7 @@ class DeletedContribsPager extends IndexPager {
         * written by the target user.
         *
         * @todo This would probably look a lot nicer in a table.
-        * @param $row
+        * @param stdClass $row
         * @return string
         */
        function formatRow( $row ) {
@@ -375,8 +375,8 @@ class DeletedContributionsPage extends SpecialPage {
 
        /**
         * Generates the subheading with links
-        * @param $userObj User object for the target
-        * @return String: appropriately-escaped HTML to be output literally
+        * @param User $userObj User object for the target
+        * @return string Appropriately-escaped HTML to be output literally
         * @todo FIXME: Almost the same as contributionsSub in SpecialContributions.php. Could be combined.
         */
        function getSubTitle( $userObj ) {
@@ -472,7 +472,12 @@ class DeletedContributionsPage extends SpecialPage {
                        $links = $this->getLanguage()->pipeList( $tools );
 
                        // Show a note if the user is blocked and display the last block log entry.
-                       if ( $userObj->isBlocked() ) {
+                       $block = Block::newFromTarget( $userObj, $userObj );
+                       if ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) {
+                               if ( $block->getType() == Block::TYPE_RANGE ) {
+                                       $nt = MWNamespace::getCanonicalName( NS_USER ) . ':' . $block->getTarget();
+                               }
+
                                // LogEventsList::showLogExtract() wants the first parameter by ref
                                $out = $this->getOutput();
                                LogEventsList::showLogExtract(
@@ -485,7 +490,7 @@ class DeletedContributionsPage extends SpecialPage {
                                                'showIfEmpty' => false,
                                                'msgKey' => array(
                                                        'sp-contributions-blocked-notice',
-                                                       $nt->getText() # Support GENDER in 'sp-contributions-blocked-notice'
+                                                       $userObj->getName() # Support GENDER in 'sp-contributions-blocked-notice'
                                                ),
                                                'offset' => '' # don't use $this->getRequest() parameter offset
                                        )
@@ -498,7 +503,7 @@ class DeletedContributionsPage extends SpecialPage {
 
        /**
         * Generates the namespace selector form with hidden attributes.
-        * @param array $options the options to be included.
+        * @param array $options The options to be included.
         * @return string
         */
        function getForm( $options ) {