From d292e7b100c786e15d2c67fdee19c3ce0368c56c Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 10 Jan 2008 02:28:58 +0000 Subject: [PATCH] Do not log user rights change that didn't change anything --- RELEASE-NOTES | 2 +- includes/SpecialUserrights.php | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 5d74b846e8..fa39373945 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -293,7 +293,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 12489) Special:Userrights listed in restricted section again * (bug 12553) Fixed invalid XHTML in edit conflict screen * (bug 12505) Fixed section=0 with action=raw - +* Do not log user rights change that didn't change anything == Parser changes in 1.12 == diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index 40fe55a5e8..4b0a50a6b6 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -136,17 +136,19 @@ class UserrightsPage extends SpecialPage { wfRunHooks( 'UserRights', array( &$user, $addgroup, $removegroup ) ); } - $log = new LogPage( 'rights' ); - - global $wgRequest; - $log->addEntry( 'rights', - $user->getUserPage(), - $wgRequest->getText( 'user-reason' ), - array( - $this->makeGroupNameList( $oldGroups ), - $this->makeGroupNameList( $newGroups ) - ) - ); + if( $addgroup or $removegroup ) { + $log = new LogPage( 'rights' ); + + global $wgRequest; + $log->addEntry( 'rights', + $user->getUserPage(), + $wgRequest->getText( 'user-reason' ), + array( + $this->makeGroupNameList( $oldGroups ), + $this->makeGroupNameList( $newGroups ) + ) + ); + } } /** -- 2.20.1