Add clean_file_name function to fix merge conflict

This commit is contained in:
Marcus Hill 2022-05-01 18:46:45 +01:00
parent 61777116a9
commit 705060d1df
1 changed files with 12 additions and 0 deletions

View File

@ -405,6 +405,18 @@ 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;
}
// Cross-Site Request Forgery check for sensitive functions
// Validates the CSRF token provided matches the one in the users session
function validateCSRFToken($token){