Use Revision::isCurrent() in ApiParse.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 17 Sep 2012 18:14:27 +0000 (20:14 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 17 Sep 2012 18:14:27 +0000 (20:14 +0200)
We have a loaded Revision object so we may use that
method as well.

Change-Id: Ie8bb871f8874871d7df3111d39ba23a01769cd34

includes/api/ApiParse.php

index db6e2bb..2fcdc38 100644 (file)
@@ -91,7 +91,7 @@ class ApiParse extends ApiBase {
                                $popts->enableLimitReport( !$params['disablepp'] );
 
                                // If for some reason the "oldid" is actually the current revision, it may be cached
-                               if ( $titleObj->getLatestRevID() === intval( $oldid ) )  {
+                               if ( $rev->isCurrent() )  {
                                        // May get from/save to parser cache
                                        $p_result = $this->getParsedSectionOrText( $pageObj, $popts, $pageid,
                                                 isset( $prop['wikitext'] ) ) ;