New: Add parameter unaccent
This commit is contained in:
parent
b6b33877a7
commit
3ef88384b8
@ -430,14 +430,15 @@ function dol_size($size,$type='')
|
|||||||
*
|
*
|
||||||
* @param string $str String to clean
|
* @param string $str String to clean
|
||||||
* @param string $newstr String to replace bad chars with
|
* @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_)
|
* @return string String cleaned (a-zA-Z_)
|
||||||
*
|
*
|
||||||
* @see dol_string_nospecial, dol_string_unaccent
|
* @see dol_string_nospecial, dol_string_unaccent
|
||||||
*/
|
*/
|
||||||
function dol_sanitizeFileName($str,$newstr='_')
|
function dol_sanitizeFileName($str,$newstr='_',$unaccent=1)
|
||||||
{
|
{
|
||||||
$filesystem_forbidden_chars = array('<','>',':','/','\\','?','*','|','"');
|
$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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user