From 781ba0934357e6d429cc1cf0da61beab546977d2 Mon Sep 17 00:00:00 2001 From: Victor Dubiniuk Date: Tue, 15 Jul 2014 19:43:39 +0300 Subject: [PATCH] Add escapeshellarg and set home directory in conversion test --- ajax/admin.php | 3 ++- lib/converter.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ajax/admin.php b/ajax/admin.php index 48b6ea05..524b9780 100644 --- a/ajax/admin.php +++ b/ajax/admin.php @@ -43,7 +43,8 @@ wAAAQACAAAAAAAAAAAAAAAAAAAAAAACAAAAAtXN1ZwuGxCTlwgAKyz5rkQAAAAF1c3VnC4bEJOXCAArL $params = ' --headless --convert-to ' . escapeshellarg($targetFilter) . ' --outdir ' . escapeshellarg($outdir) - . ' --writer '. escapeshellarg($infile) . ' 2>&1'; + . ' --writer '. escapeshellarg($infile) + . ' -env:UserInstallation=file://' . escapeshellarg(get_temp_dir()) . ' 2>&1' ; file_put_contents($infile, $input); diff --git a/lib/converter.php b/lib/converter.php index 5a5a9144..50fa1f00 100644 --- a/lib/converter.php +++ b/lib/converter.php @@ -49,7 +49,7 @@ class Converter { $params = ' --headless --convert-to ' . $targetFilter . ' --outdir ' . escapeshellarg($outdir) . ' --writer '. escapeshellarg($infile) - . ' -env:UserInstallation=file://' . get_temp_dir() + . ' -env:UserInstallation=file://' . escapeshellarg(get_temp_dir()) ; file_put_contents($infile, $input);