From 1834031f7e325f7a35144639e812516898ff65d7 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Thu, 29 Aug 2013 19:04:21 +0530 Subject: [PATCH] CRM-13292 fix ---------------------------------------- * CRM-13292: wkhtmltopdf setting should allow use of xvfb-run http://issues.civicrm.org/jira/browse/CRM-13292 --- CRM/Admin/Form/Setting/Miscellaneous.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Admin/Form/Setting/Miscellaneous.php b/CRM/Admin/Form/Setting/Miscellaneous.php index 38b64eb9b6..c75bbd4adb 100644 --- a/CRM/Admin/Form/Setting/Miscellaneous.php +++ b/CRM/Admin/Form/Setting/Miscellaneous.php @@ -122,9 +122,13 @@ class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting { if (!empty($fields['wkhtmltopdfPath'])) { // check and ensure that thi leads to the wkhtmltopdf binary // and it is a valid executable binary + // Only check the first space separated piece to allow for a value + // such as /usr/bin/xvfb-run -- wkhtmltopdf (CRM-13292) + $pieces = explode(' ', $fields['wkhtmltopdfPath']); + $path = $pieces[0]; if ( - !file_exists($fields['wkhtmltopdfPath']) || - !is_executable($fields['wkhtmltopdfPath']) + !file_exists($path) || + !is_executable($path) ) { $errors['wkhtmltopdfPath'] = ts('The wkhtmltodfPath does not exist or is not valid'); } -- 2.25.1