Skip to content
Snippets Groups Projects
Commit d148b6cc authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FIX #11611 TIME 0:05 added timeout to unoconv command

parent e8412119
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ class ConvertPdfController ...@@ -37,7 +37,7 @@ class ConvertPdfController
$tmpPath = CoreConfigModel::getTmpPath(); $tmpPath = CoreConfigModel::getTmpPath();
ConvertPdfController::addBom($aArgs['fullFilename']); ConvertPdfController::addBom($aArgs['fullFilename']);
$command = "unoconv -f pdf " . escapeshellarg($aArgs['fullFilename']); $command = "timeout 10 unoconv -f pdf " . escapeshellarg($aArgs['fullFilename']);
exec('export HOME=' . $tmpPath . ' && '.$command.' 2>&1', $output, $return); exec('export HOME=' . $tmpPath . ' && '.$command.' 2>&1', $output, $return);
...@@ -93,7 +93,7 @@ class ConvertPdfController ...@@ -93,7 +93,7 @@ class ConvertPdfController
if (strtolower($docInfo["extension"]) != 'pdf') { if (strtolower($docInfo["extension"]) != 'pdf') {
ConvertPdfController::addBom($tmpPath.$fileNameOnTmp.'.'.$docInfo["extension"]); ConvertPdfController::addBom($tmpPath.$fileNameOnTmp.'.'.$docInfo["extension"]);
$command = "unoconv -f pdf " . escapeshellarg($tmpPath.$fileNameOnTmp.'.'.$docInfo["extension"]); $command = "timeout 10 unoconv -f pdf " . escapeshellarg($tmpPath.$fileNameOnTmp.'.'.$docInfo["extension"]);
exec('export HOME=' . $tmpPath . ' && '.$command, $output, $return); exec('export HOME=' . $tmpPath . ' && '.$command, $output, $return);
if (!file_exists($tmpPath.$fileNameOnTmp.'.pdf')) { if (!file_exists($tmpPath.$fileNameOnTmp.'.pdf')) {
...@@ -148,7 +148,7 @@ class ConvertPdfController ...@@ -148,7 +148,7 @@ class ConvertPdfController
file_put_contents($tmpPath . $tmpFilename, base64_decode($aArgs['encodedResource'])); file_put_contents($tmpPath . $tmpFilename, base64_decode($aArgs['encodedResource']));
ConvertPdfController::addBom($tmpPath.$tmpFilename); ConvertPdfController::addBom($tmpPath.$tmpFilename);
$command = "unoconv -f pdf {$tmpPath}{$tmpFilename}"; $command = "timeout 10 unoconv -f pdf {$tmpPath}{$tmpFilename}";
exec('export HOME=' . $tmpPath . ' && '.$command, $output, $return); exec('export HOME=' . $tmpPath . ' && '.$command, $output, $return);
if (!file_exists($tmpPath.$tmpFilename.'.pdf')) { if (!file_exists($tmpPath.$tmpFilename.'.pdf')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment