From 1ac043b6c80d36194ca1f15ac17b3c23e3219e1e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 18 Feb 2006 23:58:49 +0000 Subject: [PATCH] * Fix explicit s-maxage=0 on raw pages; should help with proxy issues in generated stylesheets... hopefully... --- RELEASE-NOTES | 2 ++ includes/RawPage.php | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e79b15a464..c53d6b71d9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/RawPage.php b/includes/RawPage.php index 1093cf9e06..ee28f47b21 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -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'; -- 2.20.1