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:
Dany De Bontridder 2017-01-28 09:41:13 +01:00
parent 4c4128d619
commit c9bf802d81
2 changed files with 24 additions and 7 deletions

View file

@ -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;
}
?>