(bug 14044) Don't increment page view counters on views from bot users
authorLeon Weber <leon@users.mediawiki.org>
Thu, 8 May 2008 15:01:40 +0000 (15:01 +0000)
committerLeon Weber <leon@users.mediawiki.org>
Thu, 8 May 2008 15:01:40 +0000 (15:01 +0000)
RELEASE-NOTES
includes/Article.php

index 6614eb9..e5e5893 100644 (file)
@@ -260,7 +260,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 13982) Disable ccmeonemails preference when user-to-user mails disabled
 * (bug 13615) Update case mappings and normalization to Unicode 5.1.0
   Note that case mappings will only be used if mbstring extension is not present.
-
+* (bug 14044) Don't increment page view counters on views from bot users
 
 === API changes in 1.13 ===
 
index 6e714fa..8d9e5ea 100644 (file)
@@ -2594,11 +2594,12 @@ class Article {
         * @private
         */
        function viewUpdates() {
-               global $wgDeferredUpdateList;
+               global $wgDeferredUpdateList, $wgUser;
 
                if ( 0 != $this->getID() ) {
+                       # Don't update page view counters on views from bot users (bug 14044)
                        global $wgDisableCounters;
-                       if( !$wgDisableCounters ) {
+                       if( !$wgDisableCounters && !$wgUser->isAllowed( 'bot' ) ) {
                                Article::incViewCount( $this->getID() );
                                $u = new SiteStatsUpdate( 1, 0, 0 );
                                array_push( $wgDeferredUpdateList, $u );
@@ -2606,7 +2607,6 @@ class Article {
                }
 
                # Update newtalk / watchlist notification status
-               global $wgUser;
                $wgUser->clearNotification( $this->mTitle );
        }