}
$ctype = $this->mRequest->getVal( 'ctype' );
- $smaxage = $this->mRequest->getInt( 'smaxage', $wgSquidMaxage );
+ $smaxage = $this->mRequest->getIntOrNull( 'smaxage' );
$maxage = $this->mRequest->getInt( 'maxage', $wgSquidMaxage );
$this->mExpandTemplates = $this->mRequest->getVal( 'templates' ) === 'expand';
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;
$url = $_SERVER['PHP_SELF'];
}
+ if( $url == '' ) {
+ # This will make the next check fail with a confusing error
+ # message, so we should mention it separately.
+ wfHttpError( 500, 'Internal Server Error',
+ "\$_SERVER['PHP_SELF'] is not set. Perhaps you're using CGI" .
+ " and haven't set cgi.fix_pathinfo = 1 in php.ini?" );
+ return;
+ }
+
if( strcmp( $wgScript, $url ) ) {
# Internet Explorer will ignore the Content-Type header if it
# thinks it sees a file extension it recognizes. Make sure that
$text = $this->getRawText();
if( !wfRunHooks( 'RawPageViewBeforeOutput', array( &$this, &$text ) ) ) {
- wfDebug( __METHOD__ . ': RawPageViewBeforeOutput hook broke raw page output.' );
+ wfDebug( __METHOD__ . ": RawPageViewBeforeOutput hook broke raw page output.\n" );
}
echo $text;