Anons have ID 0
authorAaron Schulz <aaron@users.mediawiki.org>
Sat, 17 May 2008 22:57:46 +0000 (22:57 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Sat, 17 May 2008 22:57:46 +0000 (22:57 +0000)
includes/RecentChange.php

index 2331288..6876495 100644 (file)
@@ -224,8 +224,15 @@ class RecentChange
                # E-mail notifications
                global $wgUseEnotif, $wgUser;
                if( $wgUseEnotif ) {
-                       $editor = ($wgUser->getID() == $this->mAttribs['rc_user']) ? 
-                               $wgUser : User::newFromID( $this->mAttribs['rc_user'] );
+                       // Users
+                       if( $this->mAttribs['rc_user'] ) {
+                               $editor = ($wgUser->getID() == $this->mAttribs['rc_user']) ? 
+                                       $wgUser : User::newFromID( $this->mAttribs['rc_user'] );
+                       // Anons
+                       } else {
+                               $editor = ($wgUser->getName() == $this->mAttribs['rc_user_text']) ? 
+                                       $wgUser : User::newFromName( $this->mAttribs['rc_user_text'], false );
+                       }
                        # FIXME: this would be better as an extension hook
                        $enotif = new EmailNotification();
                        $title = Title::makeTitle( $this->mAttribs['rc_namespace'], $this->mAttribs['rc_title'] );