r53738 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53737‎ | r53738 | r53739 >
Date:00:27, 25 July 2009
Author:demon
Status:ok
Tags:
Comment:
Make $headers protected and declare it as an empty array.
Modified paths:
  • /trunk/phase3/includes/WebRequest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/WebRequest.php
@@ -43,8 +43,7 @@
4444 * @ingroup HTTP
4545 */
4646 class WebRequest {
47 - protected $data = array();
48 - var $headers;
 47+ protected $data, $headers = array();
4948 private $_response, $mFixMagicQuotes;
5049
5150 public function __construct() {
@@ -632,8 +631,7 @@
633632 public function getHeader( $name ) {
634633 $name = strtoupper( $name );
635634 if ( function_exists( 'apache_request_headers' ) ) {
636 - if ( !isset( $this->headers ) ) {
637 - $this->headers = array();
 635+ if ( !$this->headers ) {
638636 foreach ( apache_request_headers() as $tempName => $tempValue ) {
639637 $this->headers[ strtoupper( $tempName ) ] = $tempValue;
640638 }
@@ -681,7 +679,7 @@
682680 */
683681 class FauxRequest extends WebRequest {
684682 private $wasPosted = false;
685 - private $session, $headers = array();
 683+ private $session = array();
686684
687685 /**
688686 * @param $data Array of *non*-urlencoded key => value pairs, the

Status & tagging log