If XMLOutputter $output arg is null, use php://output

Since pushing a null value to the argument actually sets it to null
and not the default fallback (previously $output='php://output');
This commit is contained in:
Mikael Nordfeldth 2015-07-16 23:58:04 +02:00
parent f1d9d8a6ed
commit ba5a43f2f9

View File

@ -63,12 +63,15 @@ class XMLOutputter
* *
* Initializes the wrapped XMLWriter. * Initializes the wrapped XMLWriter.
* *
* @param string $output URL for outputting, defaults to stdout * @param string $output URL for outputting, if null it defaults to stdout ('php://output')
* @param boolean $indent Whether to indent output, default true * @param boolean $indent Whether to indent output, default true
*/ */
function __construct($output='php://output', $indent=null) function __construct($output=null, $indent=null)
{ {
if (is_null($output)) {
$output = 'php://output';
}
$this->xw = new XMLWriter(); $this->xw = new XMLWriter();
$this->xw->openURI($output); $this->xw->openURI($output);
if(is_null($indent)) { if(is_null($indent)) {