jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/350123 )

Change subject: Support array or args for 3d processor
......................................................................


Support array or args for 3d processor

We're going to run this with xvfb-run, so the actual call
looks like this:
    /usr/bin/xvfb-run -a -s "-ac -screen 0 1280x1024x24" 
/srv/deployment/3d2png/deploy/src/3d2png.js ...params...

With $wg3dProcessor being just the string it is right now,
we can not do this. The entire xvfb-run up to 3d2png.js path
gets escaped as 1 argument, which it is not.

Change-Id: I247998e52e4cfcf9a50d0b82131c4a7e65115a39
---
M ThreeDHandler.php
1 file changed, 4 insertions(+), 3 deletions(-)

Approvals:
  MarkTraceur: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/ThreeDHandler.php b/ThreeDHandler.php
index 0919f23..9c7b271 100644
--- a/ThreeDHandler.php
+++ b/ThreeDHandler.php
@@ -90,12 +90,13 @@
 
                $srcPath = $image->getLocalRefPath();
 
-               $cmd = wfEscapeShellArg(
-                       $wg3dProcessor,
+               // $wg3dProcessor can be string (e.g. '/path/to/3d2png.js') or 
array
+               // (e.g. ['xvfb-run', '-a', '-s', '-ac -screen 0 1280x1024x24', 
'/path/to/3d2png.js'])
+               $cmd = wfEscapeShellArg( array_merge( (array) $wg3dProcessor, [
                        $srcPath,
                        sprintf( '%dx%d', $width, $height ),
                        $dstPath
-               );
+               ] ) );
 
                wfProfileIn( 'ThreeDHandler' );
                wfDebug( __METHOD__ . ": $cmd\n" );

-- 
To view, visit https://gerrit.wikimedia.org/r/350123
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I247998e52e4cfcf9a50d0b82131c4a7e65115a39
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/3D
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to