Remove OutputPage::uncacheableBecauseRequestvars()
authorTim Starling <tstarling@wikimedia.org>
Tue, 22 May 2012 23:37:53 +0000 (09:37 +1000)
committerTim Starling <tstarling@wikimedia.org>
Tue, 22 May 2012 23:37:53 +0000 (09:37 +1000)
Fix for r10265: OutputPage::uncacheableBecauseRequestvars() as written
in that revision is backwards, apparently declaring all requests to be
uncacheable except those with useskin or uselang. Luckily getText() has
always converted its default parameter to a string, so the triple-equals
comparisons always fail, and uncacheableBecauseRequestvars() always
returns false.

In any case, it was never necessary to suppress the client-side cache
for useskin/uselang views, so the accidental behaviour was appropriate.

Change-Id: I520940867509b986a47d63ead9b549e8aa82fa1f

includes/OutputPage.php

index b1bd14a..ad4e4ef 100644 (file)
@@ -1682,18 +1682,6 @@ class OutputPage extends ContextSource {
                return $cookies;
        }
 
-       /**
-        * Return whether this page is not cacheable because "useskin" or "uselang"
-        * URL parameters were passed.
-        *
-        * @return Boolean
-        */
-       function uncacheableBecauseRequestVars() {
-               $request = $this->getRequest();
-               return $request->getText( 'useskin', false ) === false
-                       && $request->getText( 'uselang', false ) === false;
-       }
-
        /**
         * Check if the request has a cache-varying cookie header
         * If it does, it's very important that we don't allow public caching
@@ -1861,7 +1849,7 @@ class OutputPage extends ContextSource {
                        $response->header( $this->getXVO() );
                }
 
-               if( !$this->uncacheableBecauseRequestVars() && $this->mEnableClientCache ) {
+               if( $this->mEnableClientCache ) {
                        if(
                                $wgUseSquid && session_id() == '' && !$this->isPrintable() &&
                                $this->mSquidMaxage != 0 && !$this->haveCacheVaryCookies()