From 9c84094cd015224697dca4baf2dfe461017ffdc2 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 17 Dec 2010 15:31:01 +0000 Subject: [PATCH] * Handle output for DatabaseUpdater in the class itself, no more wfOut() usage in core :) * Mark wfOut() deprecated * CheckUser, OpenID and TitleKey still use wfOut :( --- includes/GlobalFunctions.php | 4 ++-- includes/installer/DatabaseUpdater.php | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 3aa22c8753..2e8986e69d 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -3374,8 +3374,8 @@ function wfWaitForSlaves( $maxLag, $wiki = false ) { } /** - * Output some plain text in command-line mode or in the installer (updaters.inc). - * Do not use it in any other context, its behaviour is subject to change. + * Used to be used for outputting text in the installer/updater + * @deprecated Warnings in 1.19, removal in 1.20 */ function wfOut( $s ) { global $wgCommandLineMode; diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 3d55e2560f..7af63d9acd 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -91,8 +91,7 @@ abstract class DatabaseUpdater { } /** - * Output some text. Right now this is a wrapper for wfOut, but hopefully - * that function can go away some day :) + * Output some text. If we're running from web, escape the text first. * * @param $str String: Text to output */ @@ -100,7 +99,12 @@ abstract class DatabaseUpdater { if ( $this->maintenance->isQuiet() ) { return; } - wfOut( $str ); + global $wgCommandLineMode; + if( !$wgCommandLineMode ) { + $str = htmlspecialchars( $str ); + } + echo $str; + flush(); } /** -- 2.20.1