CSteipp has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/95551


Change subject: SECURITY: Don't show deleted usernames
......................................................................

SECURITY: Don't show deleted usernames

Remove the username and javascript links

Bug: 54294
Change-Id: I4fd67ed26f0d4610296548b5e908e9379e1bf1d5
---
M CleanChanges_body.php
1 file changed, 23 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CleanChanges 
refs/changes/51/95551/1

diff --git a/CleanChanges_body.php b/CleanChanges_body.php
index ecf70e0..237147a 100644
--- a/CleanChanges_body.php
+++ b/CleanChanges_body.php
@@ -156,13 +156,24 @@
                $rc->_reqOldId = array( 'oldid' => $rc->getAttribute( 
'rc_this_oldid' ) );
                $this->makeLinks( $rc );
 
-               $stuff = $this->userToolLinks( $rc->getAttribute( 'rc_user' ),
-                       $rc->getAttribute( 'rc_user_text' ) );
-               self::$userinfo += $stuff[1];
-
-               $rc->_user = Linker::userLink( $rc->getAttribute( 'rc_user' ),
-                       $rc->getAttribute( 'rc_user_text' ) );
-               $rc->_userInfo = $stuff[0];
+               // Make user links
+               if ( $this->isDeleted( $rc, Revision::DELETED_USER ) ) {
+                       $rc->_user = ' <span class="history-deleted">' . 
$this->msg( 'rev-deleted-user' )->escaped() . '</span>';
+                       $rc->_userInfo = '';
+                       self::$userinfo += array();
+               } else {
+                       $rc->_user = Linker::userLink(
+                               $rc->getAttribute( 'rc_user' ),
+                               $rc->getAttribute( 'rc_user_text' )
+                       );
+                       $stuff = $this->userToolLinks(
+                               $rc->getAttribute( 'rc_user' ),
+                               $rc->getAttribute( 'rc_user_text' )
+                       );
+                       // TODO: userToolLinks can return ''
+                       self::$userinfo += $stuff[1];
+                       $rc->_userInfo = $stuff[0];
+               }
 
                if ( !$this->isLog( $rc ) ) {
                        $rc->_comment = $this->getComment( $rc );
@@ -444,6 +455,11 @@
 
        /**
         * Enhanced user tool links, with javascript functionality.
+        * @param int $userId user id, 0 for anons
+        * @param string $userText username
+        * @return array|string Either an array of html and array of messages, 
or ''
+        *      [0]: html span and links to user tools
+        *      [1]: array of escaped message strings
         */
        public function userToolLinks( $userId, $userText ) {
                global $wgDisableAnonTalk;

-- 
To view, visit https://gerrit.wikimedia.org/r/95551
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4fd67ed26f0d4610296548b5e908e9379e1bf1d5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CleanChanges
Gerrit-Branch: master
Gerrit-Owner: CSteipp <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to