follow up r69339:
authorMark A. Hershberger <mah@users.mediawiki.org>
Wed, 14 Jul 2010 21:46:52 +0000 (21:46 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Wed, 14 Jul 2010 21:46:52 +0000 (21:46 +0000)
* Add a missing setVaryCookie for consistency
* don't cache result when token is given in ApiFeedWatchlist

includes/api/ApiFeedWatchlist.php
includes/api/ApiParse.php
includes/api/ApiQueryDeletedrevs.php
includes/api/ApiQueryProtectedTitles.php
includes/api/ApiQueryRecentChanges.php
includes/api/ApiQueryRevisions.php
includes/api/ApiQueryUserContributions.php
includes/api/ApiQueryWatchlist.php

index 34c6650..150294b 100644 (file)
@@ -78,6 +78,9 @@ class ApiFeedWatchlist extends ApiBase {
                                $fauxReqArr['wlowner'] = $params['wlowner'];
                        }
                        if ( !is_null( $params['wltoken'] ) ) {
+                               // Don't cache tokens
+                               $this->getMain()->setCachePrivate();
+
                                $fauxReqArr['wltoken'] = $params['wltoken'];
                        }
 
index 50b9d39..01285ec 100644 (file)
@@ -188,6 +188,7 @@ class ApiParse extends ApiBase {
 
                if ( !is_null( $params['summary'] ) ) {
                        $result_array['parsedsummary'] = array();
+                       $this->getMain()->setVaryCookie();
                        $result->setContent( $result_array['parsedsummary'], $wgUser->getSkin()->formatComment( $params['summary'], $titleObj ) );
                }
 
@@ -222,6 +223,7 @@ class ApiParse extends ApiBase {
                if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) {
                        $out = new OutputPage;
                        $out->addParserOutputNoText( $p_result );
+                       $this->getMain()->setVaryCookie();
                        $userSkin = $wgUser->getSkin();
                }
 
index 9f28192..f940ff0 100644 (file)
@@ -211,6 +211,7 @@ class ApiQueryDeletedrevs extends ApiQueryBase {
 
                        if ( $fld_parsedcomment ) {
                                global $wgUser;
+                               $this->getMain()->setVaryCookie();
                                $rev['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->ar_comment, $title );
                        }
                        if ( $fld_minor && $row->ar_minor_edit == 1 ) {
index e3cac1b..5354e61 100644 (file)
@@ -102,6 +102,7 @@ class ApiQueryProtectedTitles extends ApiQueryGeneratorBase {
 
                                if ( isset( $prop['parsedcomment'] ) ) {
                                        global $wgUser;
+                                       $this->getMain()->setVaryCookie();
                                        $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->pt_reason, $title );
                                }
 
index a9f7794..33021cd 100644 (file)
@@ -378,6 +378,7 @@ class ApiQueryRecentChanges extends ApiQueryBase {
 
                if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
                        global $wgUser;
+                       $this->getMain()->setVaryCookie();
                        $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->rc_comment, $title );
                }
 
index f80b685..8a389df 100644 (file)
@@ -395,6 +395,7 @@ class ApiQueryRevisions extends ApiQueryBase {
 
                                if ( $this->fld_parsedcomment ) {
                                        global $wgUser;
+                                       $this->getMain()->setVaryCookie();
                                        $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $comment, $title );
                                }
                        }
index 310ca76..42ac26e 100644 (file)
@@ -321,6 +321,7 @@ class ApiQueryContributions extends ApiQueryBase {
 
                                if ( $this->fld_parsedcomment ) {
                                        global $wgUser;
+                                       $this->getMain()->setVaryCookie();
                                        $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->rev_comment, $title );
                                }
                        }
index ad51ca8..9339ac0 100644 (file)
@@ -272,6 +272,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase {
 
                if ( $this->fld_parsedcomment && isset( $row->rc_comment ) ) {
                        global $wgUser;
+                       $this->getMain()->setVaryCookie();
                        $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $row->rc_comment, $title );
                }