From: monishdeb Date: Thu, 29 Aug 2013 13:34:21 +0000 (+0530) Subject: CRM-13292 fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1834031f7e325f7a35144639e812516898ff65d7;p=civicrm-core.git CRM-13292 fix ---------------------------------------- * CRM-13292: wkhtmltopdf setting should allow use of xvfb-run http://issues.civicrm.org/jira/browse/CRM-13292 --- 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'); }