From e68dd8114c91004fa510fc311935b0cbc32352f5 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sat, 31 Jan 2004 02:22:15 +0000 Subject: [PATCH] Fixing &bot=1, broken by new RC code --- includes/Article.php | 2 +- includes/RecentChange.php | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 93e48715cb..65d1a66ee6 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -505,7 +505,7 @@ class Article { $bot = (int)($wgUser->isBot() || $forceBot); RecentChange::notifyEdit( $now, $this->mTitle, $me2, $wgUser, $summary, - $oldid, $this->getTimestamp() ); + $oldid, $this->getTimestamp(), $bot ); Article::onArticleEdit( $this->mTitle ); } diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 476b45d7be..6ec54e52ff 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -126,8 +126,12 @@ class RecentChange # Makes an entry in the database corresponding to an edit /*static*/ function notifyEdit( $timestamp, &$title, $minor, &$user, $comment, - $oldId, $lastTimestamp ) + $oldId, $lastTimestamp, $bot = "default" ) { + if ( $bot == "default " ) { + $bot = $user->isBot(); + } + $rc = new RecentChange; $rc->mAttribs = array( 'rc_timestamp' => $timestamp, @@ -142,7 +146,7 @@ class RecentChange 'rc_comment' => $comment, 'rc_this_oldid' => 0, 'rc_last_oldid' => $oldId, - 'rc_bot' => $user->isBot() ? 1 : 0, + 'rc_bot' => $bot ? 1 : 0, 'rc_moved_to_ns' => 0, 'rc_moved_to_title' => '', 'rc_new' => 0 # obsolete @@ -157,8 +161,11 @@ class RecentChange # Makes an entry in the database corresponding to page creation # Note: the title object must be loaded with the new id using resetArticleID() - /*static*/ function notifyNew( $timestamp, &$title, $minor, &$user, $comment ) + /*static*/ function notifyNew( $timestamp, &$title, $minor, &$user, $comment, $bot = "default" ) { + if ( $bot == "default " ) { + $bot = $user->isBot(); + } $rc = new RecentChange; $rc->mAttribs = array( 'rc_timestamp' => $timestamp, @@ -173,7 +180,7 @@ class RecentChange 'rc_comment' => $comment, 'rc_this_oldid' => 0, 'rc_last_oldid' => 0, - 'rc_bot' => $user->isBot() ? 1 : 0, + 'rc_bot' => $bot ? 1 : 0, 'rc_moved_to_ns' => 0, 'rc_moved_to_title' => '', 'rc_new' => 1 # obsolete -- 2.20.1