php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch exec-to-passthru for Online Doc Editor problem Bug #63697

Patch version 2012-12-25 14:05 UTC

Return to Bug #63697 | Download this patch
Patch Revisions:

Developer: shein@php.net

Index: php/SaferExec.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- php/SaferExec.php	(revision 328895)
+++ php/SaferExec.php	(revision )
@@ -24,14 +24,16 @@
             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());
     }
 }
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 15:01:34 2024 UTC