function _fillpdf_process_filename in FillPDF 7
Same name and namespace in other branches
- 6 fillpdf.module \_fillpdf_process_filename()
- 7.2 fillpdf.module \_fillpdf_process_filename()
4 calls to _fillpdf_process_filename()
- fillpdf_build_filename in ./fillpdf.module
- fillpdf_merge_handle_pdf in ./fillpdf.deprecated.inc
- Figure out what to do with the PDF and do it.
- fillpdf_merge_perform_pdf_action in ./fillpdf.module
- Figure out what to do with the PDF and do it.
- fillpdf_rules_action_save_to_file in ./fillpdf.rules.inc
- Save the PDF to a file and return the file path.
File
- ./fillpdf.module, line 1354
Code
function _fillpdf_process_filename($original, $token_objects) {
if (!empty($token_objects)) {
$original = token_replace($original, $token_objects, array(
'sanitize' => FALSE,
));
}
$output_name = str_replace(' ', '_', $original);
$output_name = preg_replace('/\\.pdf$/i', '', $output_name);
$output_name = preg_replace('/[^a-zA-Z0-9_.-]+/', '', $output_name) . '.pdf';
return $output_name;
}