Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13974669
D11092.id26710.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.id26710.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, Oct 19, 6:44 AM (2 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730833
Default Alt Text
D11092.id26710.diff (1 KB)
Attached To
Mode
D11092: Unsquelch errors when specifying bad environments to ExecFuture
Attached
Detach File
Event Timeline
Log In to Comment