Fix : when exporting files for creating a PDF in ANC , the filename can be a problem if he contains some char.
This commit is contained in:
parent
4c4128d619
commit
c9bf802d81
2 changed files with 24 additions and 7 deletions
|
|
@ -245,4 +245,18 @@ function check_parameter($p_array,$p_needed)
|
|||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
/**
|
||||
* sanitize the filename remove character which could be a problem,
|
||||
* @param string $p_filename the filename to clean
|
||||
* @return string Filename without bad char.
|
||||
*/
|
||||
function clean_filename($p_filename)
|
||||
{
|
||||
$filename=$p_filename;
|
||||
foreach (array('/','*','<','>',';',',','\\',':','(',')',' ','[',']') as $i) {
|
||||
$filename= str_replace($i, "-",$filename);
|
||||
}
|
||||
return $filename;
|
||||
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue