Skip to content
Snippets Groups Projects
Commit c8b33114 authored by Kevin Kaland's avatar Kevin Kaland
Browse files

Issue #1589854: Check for file before marking for use.

parent 6ae9152f
No related branches found
No related tags found
No related merge requests found
......@@ -365,10 +365,13 @@ function fillpdf_merge_pdf($fid, $nids = NULL, $webform_arr = NULL, $sample = NU
$fields[$obj->pdf_key] = '{image}' . drupal_realpath($image_path);
$image_path_info = pathinfo(drupal_realpath($image_path));
// Store the image data to transmit to the remote service if necessary
$image_data[$obj->pdf_key] = array(
'data' => base64_encode(file_get_contents(drupal_realpath($image_path))),
'filenamehash' => md5($image_path_info['filename']) . '.' . $image_path_info['extension'],
);
$file_data = file_get_contents(drupal_realpath($image_path));
if ($file_data) {
$image_data[$obj->pdf_key] = array(
'data' => base64_encode($file_data),
'filenamehash' => md5($image_path_info['filename']) . '.' . $image_path_info['extension'],
);
}
}
}
// /--- node token replacements ---
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment