Page MenuHomePhabricator

iwfix.patch

Authored By
bzimport
Nov 21 2014, 9:40 PM
Size
1 KB
Referenced Files
None
Subscribers
None

iwfix.patch

Index: includes/SpecialUserrights.php
===================================================================
--- includes/SpecialUserrights.php (revision 32202)
+++ includes/SpecialUserrights.php (working copy)
@@ -173,10 +173,26 @@
if( $newGroups != $oldGroups ) {
$log = new LogPage( 'rights' );
-
+
+ // Fix for interwiki userrights changes
+ $parts = explode( '@', $username );
+ if( count( $parts ) >= 2 ) {
+ global $wgServer;
+ regex_match( '/^([^@]*)@(.*)$/', $username, $matches );
+ regex_match( '/^(...?)(wik.*)$/', $matches[2], $iwparts );
+ $target = new Title();
+ $target->mInterwiki = ( $iwparts[2] == 'wiki' ) ? 'w' : $iwparts[2];
+ $target->mFragment = '';
+ $target->mNamespace = NS_USER;
+ $target->mUrlform = wfUrlencode( str_replace( ' ', '_', $matches[1] ) );
+ $target->mTextform = str_replace( '_', ' ', $matches[1] );
+ } else {
+ $target = $user->getUserPage();
+ }
+
global $wgRequest;
$log->addEntry( 'rights',
- $user->getUserPage(),
+ $target,
$wgRequest->getText( 'user-reason' ),
array(
$this->makeGroupNameList( $oldGroups ),

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3447
Default Alt Text
iwfix.patch (1 KB)

Event Timeline