- $cmd = wfEscapeShellArg( $wgExiv2Command )
- . " -M "
- . wfEscapeShellArg( "set Exif.Image.Orientation " . $orientation['exifCode'] )
- . " "
- . wfEscapeShellArg( $filename );
-
- $retval = 0;
- $err = wfShellExec( $cmd, $retval );
+ $command = Shell::command( $wgExiv2Command,
+ '-M',
+ "set Exif.Image.Orientation {$orientation['exifCode']}",
+ $filename
+ )->includeStderr();
+
+ $result = $command->execute();
+ $retval = $result->getExitCode();