----------------------------------------
* CRM-13292: wkhtmltopdf setting should allow use of xvfb-run
http://issues.civicrm.org/jira/browse/CRM-13292
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');
}