Fix counter drift when articles are created with {{subst:}}
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 7 Apr 2006 04:20:16 +0000 (04:20 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 7 Apr 2006 04:20:16 +0000 (04:20 +0000)
includes/Article.php

index 33ffc76..f844149 100644 (file)
@@ -1179,9 +1179,6 @@ class Article {
                        return false;
                }
 
-               $this->mGoodAdjustment = (int)$this->isCountable( $text );
-               $this->mTotalAdjustment = 1;
-
                $ns = $this->mTitle->getNamespace();
                $ttl = $this->mTitle->getDBkey();
 
@@ -1191,6 +1188,13 @@ class Article {
                }
                $text = $this->preSaveTransform( $text );
 
+
+               # Set statistics members
+               # We work out if it's countable after PST to avoid counter drift 
+               # when articles are created with {{subst:}}
+               $this->mGoodAdjustment = (int)$this->isCountable( $text );
+               $this->mTotalAdjustment = 1;
+
                /* Silently ignore minoredit if not allowed */
                $isminor = $isminor && $wgUser->isAllowed('minoredit');
                $now = wfTimestampNow();