From 8decc8a496de42289ada332a2ce76150ef6df10e Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 10 May 2007 01:53:07 +0000 Subject: [PATCH] If for some weird reason user-reason is not given a value, make MySQL happy by defaulting to an empty string instead of null. Not that that should ever happen, but somehow it just did for me, so . . . --- includes/SpecialUserrights.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/SpecialUserrights.php b/includes/SpecialUserrights.php index d12a9cc411..0e61622b85 100644 --- a/includes/SpecialUserrights.php +++ b/includes/SpecialUserrights.php @@ -74,7 +74,7 @@ class UserrightsForm extends HTMLForm { * @param string $reason Reason for group change * */ - function saveUserGroups( $username, $removegroup, $addgroup, $reason ) { + function saveUserGroups( $username, $removegroup, $addgroup, $reason = '' ) { global $wgOut; $u = User::newFromName($username); @@ -108,7 +108,7 @@ class UserrightsForm extends HTMLForm { wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) ); wfDebug( 'newGroups: ' . print_r( $newGroups, true ) ); - wfRunHooks( 'UserRights', array( &$u, $addgroup, $removegroup ) ); + wfRunHooks( 'UserRights', array( &$u, $addgroup, $removegroup ) ); $log = new LogPage( 'rights' ); $log->addEntry( 'rights', Title::makeTitle( NS_USER, $u->getName() ), $reason, array( $this->makeGroupNameList( $oldGroups ), $this->makeGroupNameList( $newGroups ) ) ); -- 2.20.1