From df408a59ad80994b3551ff9cd913aae4b5330716 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 31 Dec 2008 21:05:21 +0000 Subject: [PATCH] Revert r45160 "(bug 11330) Passing default to Request->getInt() is good enough, rather than added code to do the same thing" This rev changes the behavior, forcing $smaxage to $wgSquidMaxage in cases where we would have previously ended up with $wgForcedRawSMaxage or 0. --- includes/RawPage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/RawPage.php b/includes/RawPage.php index 6b41e856ac..5d5c081e1a 100644 --- a/includes/RawPage.php +++ b/includes/RawPage.php @@ -34,7 +34,7 @@ class RawPage { } $ctype = $this->mRequest->getVal( 'ctype' ); - $smaxage = $this->mRequest->getInt( 'smaxage', $wgSquidMaxage ); + $smaxage = $this->mRequest->getIntOrNull( 'smaxage', $wgSquidMaxage ); $maxage = $this->mRequest->getInt( 'maxage', $wgSquidMaxage ); $this->mExpandTemplates = $this->mRequest->getVal( 'templates' ) === 'expand'; @@ -73,9 +73,11 @@ class RawPage { if( $gen == 'css' ) { $this->mGen = $gen; + if( is_null( $smaxage ) ) $smaxage = $wgSquidMaxage; if($ctype == '') $ctype = 'text/css'; } elseif( $gen == 'js' ) { $this->mGen = $gen; + if( is_null( $smaxage ) ) $smaxage = $wgSquidMaxage; if($ctype == '') $ctype = $wgJsMimeType; } else { $this->mGen = false; -- 2.20.1