Followup r101149: make FauxRequest::__construct() use $_SESSION if the session parameter isn't given
This commit is contained in:
parent
fc3b1648de
commit
eca300daff
1 changed files with 5 additions and 2 deletions
|
|
@ -1179,7 +1179,7 @@ class FauxRequest extends WebRequest {
|
|||
* @param $data Array of *non*-urlencoded key => value pairs, the
|
||||
* fake GET/POST values
|
||||
* @param $wasPosted Bool: whether to treat the data as POST
|
||||
* @param $session Mixed: session array or null
|
||||
* @param $session Mixed: session array or null. If null, $_SESSION will be used
|
||||
*/
|
||||
public function __construct( $data, $wasPosted = false, $session = null ) {
|
||||
if( is_array( $data ) ) {
|
||||
|
|
@ -1188,8 +1188,11 @@ class FauxRequest extends WebRequest {
|
|||
throw new MWException( "FauxRequest() got bogus data" );
|
||||
}
|
||||
$this->wasPosted = $wasPosted;
|
||||
if( $session )
|
||||
if( $session ) {
|
||||
$this->session = $session;
|
||||
} else {
|
||||
$this->session = $_SESSION;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue