forked from Wavyzz/dolibarr
New: Add parameter unaccent
This commit is contained in:
@@ -430,14 +430,15 @@ function dol_size($size,$type='')
|
||||
*
|
||||
* @param string $str String to clean
|
||||
* @param string $newstr String to replace bad chars with
|
||||
* @param string $unaccent 1=Remove also accent (default), 0 do not remove them
|
||||
* @return string String cleaned (a-zA-Z_)
|
||||
*
|
||||
* @see dol_string_nospecial, dol_string_unaccent
|
||||
*/
|
||||
function dol_sanitizeFileName($str,$newstr='_')
|
||||
function dol_sanitizeFileName($str,$newstr='_',$unaccent=1)
|
||||
{
|
||||
$filesystem_forbidden_chars = array('<','>',':','/','\\','?','*','|','"');
|
||||
return dol_string_nospecial(dol_string_unaccent($str), $newstr, $filesystem_forbidden_chars);
|
||||
return dol_string_nospecial($unaccent?dol_string_unaccent($str):$str, $newstr, $filesystem_forbidden_chars);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user