require_once 'System.php';
+ $timeout= System::which('timeout');
+ if (empty($timeout)) {
+ $this->h404("missing timeout");
+ }
+
$xvfb = System::which('xvfb');
if (empty($xvfb)) {
$this->h404("missing xvfb");
unlink($outpr);
$out = $outpr .'.pdf';
- $cmd = "$xvfb --auto-servernum $webkitpdf " .
- " --url " . escapeshellarg($_REQUEST['url']) . ' '
+ $cmd = "timeout 30s $xvfb --auto-servernum $webkitpdf " .
+ " --url " . escapeshellarg($_REQUEST['url']) . ' ' .
" --pdf " . $tmpfile . ' ';