(bug 9812) (regression) Edit links in regular pages now include "oldid"
authorRiver Tarnell <river@users.mediawiki.org>
Mon, 7 May 2007 07:57:29 +0000 (07:57 +0000)
committerRiver Tarnell <river@users.mediawiki.org>
Mon, 7 May 2007 07:57:29 +0000 (07:57 +0000)
  Article::isCurrent() is called with no Revision object when the article was retrieved from the parser cache.  in this case, and then no oldid was given in the URL, it would return false, causing spurious &oldid= parameters in the edit link.  instead, if no oldid was given, assume we are viewing the current revision.

includes/Article.php

index a2f8b3b..79bc6e5 100644 (file)
@@ -500,6 +500,10 @@ class Article {
         * @return bool
         */
        function isCurrent() {
+               # If no oldid, this is the current version.
+               if ($this->getOldID() == 0)
+                       return true;
+
                return $this->exists() &&
                        isset( $this->mRevision ) &&
                        $this->mRevision->isCurrent();