diff --git a/web/download/web-log/index.php b/web/download/web-log/index.php index 35ebc335..9078d20c 100644 --- a/web/download/web-log/index.php +++ b/web/download/web-log/index.php @@ -25,11 +25,18 @@ $v_domain = escapeshellarg($_GET['domain']); if ($_GET['type'] == 'access') $type = 'access'; if ($_GET['type'] == 'error') $type = 'error'; -exec (VESTA_CMD."v-list-web-domain-".$type."log $user ".$v_domain." 5000", $output, $return_var); -if ($return_var == 0 ) { - foreach($output as $file) { - echo $file . "\n"; - } + + +$cmd = implode(" ", array( + escapeshellarg(HESTIA_CMD . "v-list-web-domain-" . $type . "log"), + escapeshellarg($user), + escapeshellarg($v_domain), + "5000", +)); +passthru($cmd, $return_var); +if ($return_var != 0) { + $errstr = "Internal server error: command returned non-zero: {$return_var}: {$cmd}"; + echo $errstr; + throw new Exception($errstr); // make sure it ends up in an errorlog somewhere } -?>