r22060 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22059‎ | r22060 | r22061 >
Date:01:53, 10 May 2007
Author:simetrical
Status:old
Tags:
Comment:
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 . . .
Modified paths:
  • /trunk/phase3/includes/SpecialUserrights.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialUserrights.php
@@ -74,7 +74,7 @@
7575 * @param string $reason Reason for group change
7676 *
7777 */
78 - function saveUserGroups( $username, $removegroup, $addgroup, $reason ) {
 78+ function saveUserGroups( $username, $removegroup, $addgroup, $reason = '' ) {
7979 global $wgOut;
8080 $u = User::newFromName($username);
8181
@@ -108,7 +108,7 @@
109109 wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) );
110110 wfDebug( 'newGroups: ' . print_r( $newGroups, true ) );
111111
112 - wfRunHooks( 'UserRights', array( &$u, $addgroup, $removegroup ) );
 112+ wfRunHooks( 'UserRights', array( &$u, $addgroup, $removegroup ) );
113113 $log = new LogPage( 'rights' );
114114 $log->addEntry( 'rights', Title::makeTitle( NS_USER, $u->getName() ), $reason, array( $this->makeGroupNameList( $oldGroups ),
115115 $this->makeGroupNameList( $newGroups ) ) );