From 6ced476cebf015e1b5d654c557d1dadcf7cbd1ae Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 9 Jan 2009 18:38:10 +0000 Subject: [PATCH] Clean up log restrictions check --- includes/LogPage.php | 11 ++++------- includes/RecentChange.php | 12 +++++++++--- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/includes/LogPage.php b/includes/LogPage.php index d3016c0523..80280fbe52 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -80,13 +80,10 @@ class LogPage { } # And update recentchanges if( $this->updateRecentChanges ) { - # Don't add private logs to RC! - if( !isset($wgLogRestrictions[$this->type]) || $wgLogRestrictions[$this->type]=='*' ) { - $titleObj = SpecialPage::getTitleFor( 'Log', $this->type ); - $rcComment = $this->getRcComment(); - RecentChange::notifyLog( $now, $titleObj, $this->doer, $rcComment, '', - $this->type, $this->action, $this->target, $this->comment, $this->params, $newId ); - } + $titleObj = SpecialPage::getTitleFor( 'Log', $this->type ); + $rcComment = $this->getRcComment(); + RecentChange::notifyLog( $now, $titleObj, $this->doer, $rcComment, '', $this->type, + $this->action, $this->target, $this->comment, $this->params, $newId ); } else if( $this->sendToUDP ) { # Notify external application via UDP. # We send this to IRC but do not want to add it the RC table. diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 4a8fa8f530..f5dc14dd1d 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -473,16 +473,22 @@ class RecentChange RecentChange::notifyMove( $timestamp, $oldTitle, $newTitle, $user, $comment, $ip, true ); } - public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', - $type, $action, $target, $logComment, $params, $newId=0 ) + public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', $type, + $action, $target, $logComment, $params, $newId=0 ) { + global $wgLogRestrictions; + # Don't add private logs to RC! + if( isset($wgLogRestrictions[$type]) && !$wgLogRestrictions[$type] == '*' ) { + return false; + } $rc = self::newLogEntry( $timestamp, $title, $user, $actionComment, $ip, $type, $action, $target, $logComment, $params, $newId ); $rc->save(); + return true; } public static function newLogEntry( $timestamp, &$title, &$user, $actionComment, $ip='', - $type, $action, $target, $logComment, $params, $newId=0 ) + $type, $action, $target, $logComment, $params, $newId=0 ) { global $wgRequest; -- 2.20.1