Merge "Remove Revision::getRevisionText from migrateArchiveText"
[lhc/web/wiklou.git] / includes / export / DumpPipeOutput.php
index 26010da..4e61434 100644 (file)
  * @file
  */
 
+use MediaWiki\Shell\Shell;
+
 /**
  * @ingroup Dump
  */
 class DumpPipeOutput extends DumpFileOutput {
        protected $command, $filename;
+       /** @var resource|bool */
        protected $procOpenResource = false;
 
        /**
@@ -38,7 +41,7 @@ class DumpPipeOutput extends DumpFileOutput {
         */
        function __construct( $command, $file = null ) {
                if ( !is_null( $file ) ) {
-                       $command .= " > " . wfEscapeShellArg( $file );
+                       $command .= " > " . Shell::escape( $file );
                }
 
                $this->startCommand( $command );
@@ -70,15 +73,14 @@ class DumpPipeOutput extends DumpFileOutput {
        }
 
        /**
-        * @param string $newname
+        * @inheritDoc
         */
        function closeRenameAndReopen( $newname ) {
                $this->closeAndRename( $newname, true );
        }
 
        /**
-        * @param string $newname
-        * @param bool $open
+        * @inheritDoc
         */
        function closeAndRename( $newname, $open = false ) {
                $newname = $this->checkRenameArgCount( $newname );
@@ -94,7 +96,7 @@ class DumpPipeOutput extends DumpFileOutput {
                        $this->renameOrException( $newname );
                        if ( $open ) {
                                $command = $this->command;
-                               $command .= " > " . wfEscapeShellArg( $this->filename );
+                               $command .= " > " . Shell::escape( $this->filename );
                                $this->startCommand( $command );
                        }
                }