summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjosh4trunks <joshruehlig@gmail.com>2014-07-22 22:46:38 -0700
committerjosh4trunks <joshruehlig@gmail.com>2014-07-22 22:46:38 -0700
commitacd56604928d5797e00b9ddaa11453cbeacfd4f2 (patch)
tree54deeedde854279f956d7b8212ce4daedd294606
parent4e2954673aea7b0e1e4f054a9fc2aa765e299d20 (diff)
downloadnextcloud-server-acd56604928d5797e00b9ddaa11453cbeacfd4f2.tar.gz
nextcloud-server-acd56604928d5797e00b9ddaa11453cbeacfd4f2.zip
Cleanup Document Preview
Use the env:UserInstallation flag like https://github.com/owncloud/documents/blob/master/lib/converter.php. This will stop the creating of multiple directories for document conversion in tmpDir.
-rw-r--r--lib/private/preview/office-cl.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/private/preview/office-cl.php b/lib/private/preview/office-cl.php
index 6e4d4321eb7..81e0cf4b6ae 100644
--- a/lib/private/preview/office-cl.php
+++ b/lib/private/preview/office-cl.php
@@ -29,13 +29,12 @@ if (!\OC_Util::runningOnWindows()) {
$tmpDir = get_temp_dir();
- $defaultParameters = ' --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir ';
+ $defaultParameters = ' -env:UserInstallation=file://' . escapeshellarg($tmpDir) . ' --headless --nologo --nofirststartwizard --invisible --norestore -convert-to pdf -outdir ';
$clParameters = \OCP\Config::getSystemValue('preview_office_cl_parameters', $defaultParameters);
$exec = $this->cmd . $clParameters . escapeshellarg($tmpDir) . ' ' . escapeshellarg($absPath);
- $export = 'export HOME=/' . $tmpDir;
- shell_exec($export . "\n" . $exec);
+ shell_exec($exec);
//create imagick object from pdf
try{