Commit ffe14d04 authored by jcnventura's avatar jcnventura

Issue #883810: wrap the call to wkhtmltopdf in double quotes to avoid problems...

Issue #883810: wrap the call to wkhtmltopdf in double quotes to avoid problems with spaces in the path.
parent f7036de5
......@@ -650,7 +650,7 @@ function _print_pdf_wkhtmltopdf_version() {
$print_pdf_pdf_tool = variable_get('print_pdf_pdf_tool', PRINT_PDF_PDF_TOOL_DEFAULT);
$descriptor = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
$cmd = realpath($print_pdf_pdf_tool) . ' --version';
$cmd = '"' . realpath($print_pdf_pdf_tool) . '" --version';
$process = proc_open($cmd, $descriptor, $pipes, NULL, NULL);
if (is_resource($process)) {
$content = stream_get_contents($pipes[1]);
......
......@@ -378,7 +378,7 @@ function _print_pdf_wkhtmltopdf($print, $html, $filename = NULL) {
}
$descriptor = array(0 => array('pipe', 'r'), 1 => array('pipe', 'w'), 2 => array('pipe', 'w'));
$cmd = realpath($print_pdf_pdf_tool) . " --page-size $print_pdf_paper_size --orientation $print_pdf_page_orientation --dpi $dpi $print_pdf_wkhtmltopdf_options - -";
$cmd = '"' . realpath($print_pdf_pdf_tool) . "\" --page-size $print_pdf_paper_size --orientation $print_pdf_page_orientation --dpi $dpi $print_pdf_wkhtmltopdf_options - -";
$process = proc_open($cmd, $descriptor, $pipes, NULL, NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment