From 5855d504b53d2f6a2834d7445bf71e67e9e14b75 Mon Sep 17 00:00:00 2001 From: Ariel Glenn Date: Fri, 4 Jun 2010 01:43:56 +0000 Subject: [PATCH] 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 --- maintenance/Maintenance.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 ); + } } /** -- 2.20.1