Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14029839
D11092.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11092.diff
View Options
diff --git a/src/future/exec/ExecFuture.php b/src/future/exec/ExecFuture.php
--- a/src/future/exec/ExecFuture.php
+++ b/src/future/exec/ExecFuture.php
@@ -636,6 +636,26 @@
}
}
+
+ // NOTE: Convert all the environmental variables we're going to pass
+ // into strings before we install PhutilErrorTrap. If something in here
+ // is really an object which is going to throw when we try to turn it
+ // into a string, we want the exception to escape here -- not after we
+ // start trapping errors.
+ $env = $this->env;
+ if ($env !== null) {
+ foreach ($env as $key => $value) {
+ $env[$key] = (string)$value;
+ }
+ }
+
+ // Same for the working directory.
+ if ($this->cwd === null) {
+ $cwd = null;
+ } else {
+ $cwd = (string)$this->cwd;
+ }
+
// NOTE: See note above about Phage.
if (class_exists('PhutilErrorTrap')) {
$trap = new PhutilErrorTrap();
@@ -647,8 +667,8 @@
$unmasked_command,
self::$descriptorSpec,
$pipes,
- $this->cwd,
- $this->env);
+ $cwd,
+ $env);
if ($trap) {
$err = $trap->getErrorsAsString();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 9:47 PM (19 h, 16 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730833
Default Alt Text
D11092.diff (1 KB)
Attached To
Mode
D11092: Unsquelch errors when specifying bad environments to ExecFuture
Attached
Detach File
Event Timeline
Log In to Comment