Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | * @package MediaWiki |
12 | 12 | */ |
13 | 13 | class OutputPage { |
14 | | - var $mHeaders, $mMetatags, $mKeywords; |
| 14 | + var $mMetatags, $mKeywords; |
15 | 15 | var $mLinktags, $mPagetitle, $mBodytext, $mDebugtext; |
16 | 16 | var $mHTMLtitle, $mRobotpolicy, $mIsarticle, $mPrintable; |
17 | 17 | var $mSubtitle, $mRedirect, $mStatusCode; |
— | — | @@ -35,8 +35,7 @@ |
36 | 36 | * Initialise private variables |
37 | 37 | */ |
38 | 38 | function OutputPage() { |
39 | | - $this->mHeaders = $this->mMetatags = |
40 | | - $this->mKeywords = $this->mLinktags = array(); |
| 39 | + $this->mMetatags = $this->mKeywords = $this->mLinktags = array(); |
41 | 40 | $this->mHTMLtitle = $this->mPagetitle = $this->mBodytext = |
42 | 41 | $this->mRedirect = $this->mLastModified = |
43 | 42 | $this->mSubtitle = $this->mDebugtext = $this->mRobotpolicy = |
— | — | @@ -54,9 +53,13 @@ |
55 | 54 | $this->mRevisionId = null; |
56 | 55 | $this->mNewSectionLink = false; |
57 | 56 | } |
| 57 | + |
| 58 | + function redirect( $url, $responsecode = '302' ) { |
| 59 | + # Strip newlines as a paranoia check for header injection in PHP<5.1.2 |
| 60 | + $this->mRedirect = str_replace( "\n", '', $url ); |
| 61 | + $this->mRedirectCode = $responsecode; |
| 62 | + } |
58 | 63 | |
59 | | - function addHeader( $name, $val ) { array_push( $this->mHeaders, $name.': '.$val ); } |
60 | | - function redirect( $url, $responsecode = '302' ) { $this->mRedirect = $url; $this->mRedirectCode = $responsecode; } |
61 | 64 | function setStatusCode( $statusCode ) { $this->mStatusCode = $statusCode; } |
62 | 65 | |
63 | 66 | # To add an http-equiv meta tag, precede the name with "http:" |