From e28aaea397d0f6f9b28a4b9fe755589e51ae0950 Mon Sep 17 00:00:00 2001 From: "Mark A. Hershberger" Date: Wed, 14 Jul 2010 21:46:52 +0000 Subject: [PATCH] follow up r69339: * Add a missing setVaryCookie for consistency * don't cache result when token is given in ApiFeedWatchlist --- includes/api/ApiFeedWatchlist.php | 3 +++ includes/api/ApiParse.php | 2 ++ includes/api/ApiQueryDeletedrevs.php | 1 + includes/api/ApiQueryProtectedTitles.php | 1 + includes/api/ApiQueryRecentChanges.php | 1 + includes/api/ApiQueryRevisions.php | 1 + includes/api/ApiQueryUserContributions.php | 1 + includes/api/ApiQueryWatchlist.php | 1 + 8 files changed, 11 insertions(+) diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 34c6650bdd..150294be90 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -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']; } diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 50b9d395ad..01285ecf55 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -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(); } diff --git a/includes/api/ApiQueryDeletedrevs.php b/includes/api/ApiQueryDeletedrevs.php index 9f28192f88..f940ff03e8 100644 --- a/includes/api/ApiQueryDeletedrevs.php +++ b/includes/api/ApiQueryDeletedrevs.php @@ -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 ) { diff --git a/includes/api/ApiQueryProtectedTitles.php b/includes/api/ApiQueryProtectedTitles.php index e3cac1b319..5354e61580 100644 --- a/includes/api/ApiQueryProtectedTitles.php +++ b/includes/api/ApiQueryProtectedTitles.php @@ -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 ); } diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index a9f7794859..33021cd795 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -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 ); } diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index f80b6855e5..8a389dfb08 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -395,6 +395,7 @@ class ApiQueryRevisions extends ApiQueryBase { if ( $this->fld_parsedcomment ) { global $wgUser; + $this->getMain()->setVaryCookie(); $vals['parsedcomment'] = $wgUser->getSkin()->formatComment( $comment, $title ); } } diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 310ca768eb..42ac26e896 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -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 ); } } diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index ad51ca8f3d..9339ac01cd 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -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 ); } -- 2.20.1