Index: trunk/extensions/ExternalPages/ExternalPages_body.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | * process parameters of the request |
59 | 59 | */ |
60 | 60 | private function parseParams() { |
61 | | - global $wgRequest, $wgServer; |
| 61 | + global $wgRequest, $wgServer, $wgLegalTitleChars; |
62 | 62 | |
63 | 63 | if (!$wgRequest->getVal( 'EPyear') ) { |
64 | 64 | $this->mYear=false; |
— | — | @@ -102,6 +102,12 @@ |
103 | 103 | return(false); |
104 | 104 | } |
105 | 105 | $this->mPage = $wgRequest->getVal( 'EPpage' ); |
| 106 | + $this->mPage = Sanitizer::decodeCharReferences( $this->mPage ); |
| 107 | + // strictly speaking this setting may differ between local and remote wiki, oh well |
| 108 | + if ( preg_match( "/[^$wgLegalTitleChars]/", $this->mPage ) ) { |
| 109 | + ExternalPagesErrors::showError( 'externalpages-bad-page' ); |
| 110 | + return(false); |
| 111 | + } |
106 | 112 | return( true ); |
107 | 113 | } |
108 | 114 | |
— | — | @@ -127,6 +133,8 @@ |
128 | 134 | } else { |
129 | 135 | $wgRequest->response()->header( "Cache-Control: private, s-maxage=0, max-age=$maxage" ); |
130 | 136 | } |
| 137 | + $time = time() + self::EP_MAXAGE; |
| 138 | + $wgRequest->response()->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', $time ) . ' GMT' ); |
131 | 139 | return( true ); |
132 | 140 | } |
133 | 141 | |