X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fexport%2FDumpPipeOutput.php;h=4e61434f50e13685cf125d8db1ffd680efb78df8;hp=26010dae9e8ac8acac76f4ebb6bdffde3083e5fa;hb=af80076034fb734d652eb043c523c1d8df974e51;hpb=925c20a9ca669c67cc44f4468d0e0f3b33b94213 diff --git a/includes/export/DumpPipeOutput.php b/includes/export/DumpPipeOutput.php index 26010dae9e..4e61434f50 100644 --- a/includes/export/DumpPipeOutput.php +++ b/includes/export/DumpPipeOutput.php @@ -25,11 +25,14 @@ * @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 ); } }