Bug #5678 - Question marks, single quotes in field name cause trouble - cleaning hack ported from clean_filename()

This commit is contained in:
skodak
2006-06-06 10:15:49 +00:00
parent 23da79eff2
commit c0f904046c
2 changed files with 10 additions and 4 deletions
+8
View File
@@ -1239,5 +1239,13 @@ function data_convert_arrays_to_strings(&$fieldinput) {
}
}
function data_clean_field_name($fn) {
$fn = trim($fn);
//hack from clean_filename - to be replaced by something nicer later
$fn = preg_replace("/[\\000-\\x2c\\x2f\\x3a-\\x40\\x5b-\\x5e\\x60\\x7b-\\177]/s", '_', $fn);
$fn = preg_replace("/_+/", '_', $fn);
$fn = preg_replace("/\.\.+/", '.', $fn);
return $fn;
}
?>