From 3ef88384b89966fedee99ef3c137d81ceeb40d5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 21 Mar 2012 15:58:04 +0100 Subject: [PATCH] New: Add parameter unaccent --- htdocs/core/lib/functions.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5bdbc3ad554..2d9c8b9d029 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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); } /**