function _fillpdf_process_filename in FillPDF 7.2
Same name and namespace in other branches
- 6 fillpdf.module \_fillpdf_process_filename()
- 7 fillpdf.module \_fillpdf_process_filename()
3 calls to _fillpdf_process_filename()
- fillpdf_build_filename in ./
fillpdf.module - fillpdf_merge_handle_pdf 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 794 - Allows mappings of PDFs to site content
Code
function _fillpdf_process_filename($original, $token_objects) {
// Replace tokens *before* sanitization
if (!empty($token_objects)) {
$original = token_replace($original, $token_objects);
}
$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;
}