Created Sanitize file name function to fix issues with exporting PDF Documentation with clients having ' in the name ex ben's
This commit is contained in:
@@ -405,4 +405,17 @@ function getDomainExpirationDate($name){
|
||||
return '0000-00-00';
|
||||
}
|
||||
|
||||
|
||||
function clean_file_name($string){
|
||||
$string = strtolower($string);
|
||||
|
||||
// Gets rid of spaces
|
||||
$clean_file_name = preg_replace('/\s/', '', $string);
|
||||
|
||||
// Gets rid of non-alphanumerics
|
||||
$clean_file_name = preg_replace( '/[^A-Za-z0-9_]/', '', $string );
|
||||
|
||||
return $clean_file_name;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user