* Handle output for DatabaseUpdater in the class itself, no more wfOut() usage in...
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 17 Dec 2010 15:31:01 +0000 (15:31 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 17 Dec 2010 15:31:01 +0000 (15:31 +0000)
* Mark wfOut() deprecated
* CheckUser, OpenID and TitleKey still use wfOut :(

includes/GlobalFunctions.php
includes/installer/DatabaseUpdater.php

index 3aa22c8..2e8986e 100644 (file)
@@ -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;
index 3d55e25..7af63d9 100644 (file)
@@ -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();
        }
 
        /**