From: Ariel Glenn Date: Fri, 4 Jun 2010 01:43:56 +0000 (+0000) Subject: restore default behavior for Maintenance::output when no channel specified (channeled... X-Git-Tag: 1.31.0-rc.0~36621 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=5855d504b53d2f6a2834d7445bf71e67e9e14b75;p=lhc%2Fweb%2Fwiklou.git restore default behavior for Maintenance::output when no channel specified (channeled behavior may or may not append newline, this breaks code that relies on the output string reaching the reader unaltered), partial fix for bug 23264 --- diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index dc33be55b9..3614adfced 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -223,8 +223,15 @@ abstract class Maintenance { if ( $this->mQuiet ) { return; } - $out = preg_replace( '/\n\z/', '', $out ); - $this->outputChanneled( $out, $channel ); + if ( $channel === null ) { + $f = fopen( 'php://stdout', 'w' ); + fwrite( $f, $out ); + fclose( $f ); + } + else { + $out = preg_replace( '/\n\z/', '', $out ); + $this->outputChanneled( $out, $channel ); + } } /**