From: River Tarnell Date: Mon, 7 May 2007 07:57:29 +0000 (+0000) Subject: (bug 9812) (regression) Edit links in regular pages now include "oldid" X-Git-Tag: 1.31.0-rc.0~53043 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=e2c99c9d37d905882a51d1858128905b2c194658;p=lhc%2Fweb%2Fwiklou.git (bug 9812) (regression) Edit links in regular pages now include "oldid" 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. --- diff --git a/includes/Article.php b/includes/Article.php index a2f8b3b005..79bc6e5114 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -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();