return; // Client cache fresh and headers sent, nothing more to do.
}
- $gen = $request->getVal( 'gen' );
- if ( $gen == 'css' || $gen == 'js' ) {
- $this->gen = true;
- }
-
$contentType = $this->getContentType();
$maxage = $request->getInt( 'maxage', $config->get( 'SquidMaxage' ) );
}
}
- if ( $text !== false && $text !== '' && $request->getVal( 'templates' ) === 'expand' ) {
+ if ( $text !== false && $text !== '' && $request->getRawVal( 'templates' ) === 'expand' ) {
$text = $wgParser->preprocess(
$text,
$title,
* @return string
*/
public function getContentType() {
- $ctype = $this->getRequest()->getVal( 'ctype' );
+ // Use getRawVal instead of getVal because we only
+ // need to match against known strings, there is no
+ // storing of localised content or other user input.
+ $ctype = $this->getRequest()->getRawVal( 'ctype' );
if ( $ctype == '' ) {
- $gen = $this->getRequest()->getVal( 'gen' );
+ // Legacy compatibilty
+ $gen = $this->getRequest()->getRawVal( 'gen' );
if ( $gen == 'js' ) {
$ctype = 'text/javascript';
} elseif ( $gen == 'css' ) {