File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 8
8
* @licence GNU General Public Licence 2.0 or later
9
9
*/
10
10
11
+ use MediaWiki \Shell \Shell ;
12
+
11
13
class PandocUploadHooks {
12
14
13
15
private static $ conversionArray = array (
@@ -85,15 +87,14 @@ public static function onUploadComplete( &$image ) {
85
87
throw new MWException (wfMessage ("pandocupload-warning-unsupported-format " )->params ( $ ext )->plain ());
86
88
}
87
89
88
- $ output = array ();
89
- $ command = sprintf (
90
- '"%s" --from=%s --to=%s "%s" 2>&1 ' ,
90
+ $ res = Shell::command (
91
91
$ wgPandocExecutablePath ,
92
- self ::$ conversionArray [$ ext ],
93
- " mediawiki " ,
92
+ ' --from= ' . self ::$ conversionArray [$ ext ],
93
+ ' --to= mediawiki' ,
94
94
$ file ->getLocalRefPath ()
95
- );
96
- exec ( $ command , $ output );
95
+ )->includeStderr ()
96
+ ->execute ();
97
+ $ output = explode ( "\n" , $ res ->getStdout () );
97
98
// post processing: transform regular tables to wikitables
98
99
foreach ( $ output as &$ line ) {
99
100
if ( $ line == "{| " ) {
You can’t perform that action at this time.
0 commit comments