X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fexport%2FDumpPipeOutput.php;h=a353c447618118d3a8ab85335d480517aeb0b1bd;hb=d183538c2ca8c9ad4cbddfb807acb4bcc35b24ae;hp=61177abe2516dc3d0ae7c43d294003e07c86acb9;hpb=77a8bbd406de8194432bbc92ce0b781ba44b43bc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/export/DumpPipeOutput.php b/includes/export/DumpPipeOutput.php index 61177abe25..a353c44761 100644 --- a/includes/export/DumpPipeOutput.php +++ b/includes/export/DumpPipeOutput.php @@ -25,6 +25,8 @@ * @file */ +use MediaWiki\Shell\Shell; + /** * @ingroup Dump */ @@ -34,11 +36,11 @@ class DumpPipeOutput extends DumpFileOutput { /** * @param string $command - * @param string $file + * @param string|null $file */ function __construct( $command, $file = null ) { if ( !is_null( $file ) ) { - $command .= " > " . wfEscapeShellArg( $file ); + $command .= " > " . Shell::escape( $file ); } $this->startCommand( $command ); @@ -61,10 +63,10 @@ class DumpPipeOutput extends DumpFileOutput { * @param string $command */ function startCommand( $command ) { - $spec = array( - 0 => array( "pipe", "r" ), - ); - $pipes = array(); + $spec = [ + 0 => [ "pipe", "r" ], + ]; + $pipes = []; $this->procOpenResource = proc_open( $command, $spec, $pipes ); $this->handle = $pipes[0]; } @@ -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 ); } }