aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-05-20 17:44:26 -0700
committerredmatrix <git@macgirvin.com>2016-05-20 17:44:26 -0700
commitb2f0d2d085c355010f1475269c4beb4fba7b07dc (patch)
tree3d2f70ab6f6eb0bd99eb8a9731b30998ff03d067 /boot.php
parentaefeda8c416f8aed34a187a5ca2408598add864f (diff)
downloadvolse-hubzilla-b2f0d2d085c355010f1475269c4beb4fba7b07dc.tar.gz
volse-hubzilla-b2f0d2d085c355010f1475269c4beb4fba7b07dc.tar.bz2
volse-hubzilla-b2f0d2d085c355010f1475269c4beb4fba7b07dc.zip
cleanup proc_run after messing it up with debugging yesterday
Diffstat (limited to 'boot.php')
-rwxr-xr-xboot.php38
1 files changed, 6 insertions, 32 deletions
diff --git a/boot.php b/boot.php
index 3ab5905ff..10244b0d0 100755
--- a/boot.php
+++ b/boot.php
@@ -1816,38 +1816,19 @@ function get_max_import_size() {
*/
function proc_run(){
- $a = get_app();
-
$args = func_get_args();
$newargs = array();
+
if(! count($args))
return;
- // expand any arrays
-
- foreach($args as $arg) {
- if(is_array($arg)) {
- foreach($arg as $n) {
- if(is_array($n)) {
- foreach($n as $w) {
- $newargs[] = $w;
- }
- }
- else {
- $newargs[] = $n;
- }
- }
- }
- else
- $newargs[] = $arg;
- }
-
- $args = $newargs;
+ $args = flatten_array_recursive($args);
$arr = array('args' => $args, 'run_cmd' => true);
call_hooks('proc_run', $arr);
+
if(! $arr['run_cmd'])
return;
@@ -1855,8 +1836,8 @@ function proc_run(){
$args[0] = ((x(App::$config,'system')) && (x(App::$config['system'],'php_path')) && (strlen(App::$config['system']['php_path'])) ? App::$config['system']['php_path'] : 'php');
- // redirect proc_run statements of legacy daemon processes to the new Daemon Master object class
- // We will keep this interface until everybody has transitioned.
+ // redirect proc_run statements of legacy daemon processes to the newer Daemon Master object class
+ // We will keep this interface until everybody has transitioned. (2016-05-20)
if(strstr($args[1],'include/')) {
// convert 'include/foo.php' to 'Foo'
@@ -1871,14 +1852,7 @@ function proc_run(){
}
}
- for($x = 0; $x < count($args); $x++) {
- if(is_array($args[$x])) {
- logger('ERROR: shell args is array . ' . print_r($args,true));
- btlogger('args:');
- }
- $args[$x] = escapeshellarg($args[$x]);
- }
-
+ $args = array_map('escapeshellarg',$args);
$cmdline = implode($args," ");
if(is_windows()) {