FIX : filepath of generated documents doesn't handle products with special characters

This commit is contained in:
atm-josselin
2019-06-24 16:05:24 +02:00
parent 7bbbe49b70
commit 7a17c43b26

View File

@@ -764,7 +764,7 @@ class FormFile
// Show file name with link to download
$out.= '<td class="minwidth200">';
$out.= '<a class="documentdownload paddingright" href="'.$documenturl.'?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).($param?'&'.$param:'').'"';
$out.= '<a class="documentdownload paddingright" href="'.$documenturl.'?modulepart='.$modulepart.'&amp;file='.urlencode(dol_sanitizePathName($relativepath)).($param?'&'.$param:'').'"';
$mime=dol_mimetype($relativepath,'',0);
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
$out.= '>';