com web/doc-editor: Fix bug #63697 ; Patch provided by shein@php.net. Thanks ;): php/SaferExec.php
| From: | Yannick Torres | Date: | Wed, 26 Dec 2012 20:42:05 +0000 |
| Subject: | com web/doc-editor: Fix bug #63697 ; Patch provided by shein@php.net. Thanks ;): php/SaferExec.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-10867@lists.php.net to get a copy of this message | ||
Commit: 14709162d86939d9d28bf26063daf5fff1d8f1cf
Author: Yannick Torrès <yannick.torres@gmail.com> Wed, 26 Dec 2012 21:42:05 +0100
Parents: b2bb7b0120b4415a0bad831f736742e91a71858f
Branches: master
Link: http://git.php.net/?p=web/doc-editor.git;a=commitdiff;h=14709162d86939d9d28bf26063daf5fff1d8f1cf
Log:
Fix bug #63697 ; Patch provided by shein@php.net. Thanks ;)
Bugs:
https://bugs.php.net/63697
Changed paths:
M php/SaferExec.php
Diff:
diff --git a/php/SaferExec.php b/php/SaferExec.php
index efd7bb5..487b1f0 100644
--- a/php/SaferExec.php
+++ b/php/SaferExec.php
@@ -24,14 +24,17 @@ class SaferExec
if (!($cur_command instanceof ExecStatement))
{
trigger_error('Unexpected object encountered. Command will not execute.',
E_USER_ERROR);
- return '';
+ return;
}
}
// Now that we've verified that we're looking at an array of ExecStatements, we
can start working with them
$command = implode('; ', $command_array);
- return exec($command, $output, $return_var);
+ ob_start();
+ passthru($command, $return_var);
+ $output = explode(PHP_EOL, ob_get_clean());
+
}
}