* Fix explicit s-maxage=0 on raw pages; should help with proxy issues in
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 18 Feb 2006 23:58:49 +0000 (23:58 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 18 Feb 2006 23:58:49 +0000 (23:58 +0000)
  generated stylesheets... hopefully...

RELEASE-NOTES
includes/RawPage.php

index e79b15a..c53d6b7 100644 (file)
@@ -640,6 +640,8 @@ fully support the editing toolbar, but was found to be too confusing.
 * Don't try to link to current page on protection tab
 * More exact checking in Title::equals() to fox moves of numerically similar
   page titles. (Odd hex title bug on 64-bit.)
+* Fix explicit s-maxage=0 on raw pages; should help with proxy issues in
+  generated stylesheets... hopefully...
 
 
 === Caveats ===
index 1093cf9..ee28f47 100644 (file)
@@ -36,27 +36,27 @@ class RawPage {
                        $this->mRequest = $request;
                }
 
-               $ctype = $this->mRequest->getText( 'ctype' );
-               $smaxage = $this->mRequest->getInt( 'smaxage', $wgSquidMaxage );
+               $ctype = $this->mRequest->getVal( 'ctype' );
+               $smaxage = $this->mRequest->getIntOrNull( 'smaxage', $wgSquidMaxage );
                $maxage = $this->mRequest->getInt( 'maxage', $wgSquidMaxage );
-               $this->mExpandTemplates = $this->mRequest->getText( 'templates' ) === 'expand';
+               $this->mExpandTemplates = $this->mRequest->getVal( 'templates' ) === 'expand';
                $this->mOldId = $this->mRequest->getInt( 'oldid' );
                # special case for 'generated' raw things: user css/js
-               $gen = $this->mRequest->getText( 'gen' );
+               $gen = $this->mRequest->getVal( 'gen' );
 
                if($gen == 'css') {
                        $this->mGen = $gen;
-                       if($smaxage == '') $smaxage = $wgSquidMaxage;
+                       if( is_null( $smaxage ) ) $smaxage = $wgSquidMaxage;
                        if($ctype == '') $ctype = 'text/css';
-               } else if ($gen == 'js') {
+               } elseif ($gen == 'js') {
                        $this->mGen = $gen;
-                       if($smaxage == '') $smaxage = $wgSquidMaxage;
+                       if( is_null( $smaxage ) ) $smaxage = $wgSquidMaxage;
                        if($ctype == '') $ctype = $wgJsMimeType;
                } else {
                        $this->mGen = false;
                }
                $this->mCharset = $wgInputEncoding;
-               $this->mSmaxage = $smaxage;
+               $this->mSmaxage = intval( $smaxage );
                $this->mMaxage = $maxage;
                if ( $ctype == '' or ! in_array( $ctype, $allowedCTypes ) ) {
                        $this->mContentType = 'text/x-wiki';