Sanitize at creation of the product instead of the creation of the filepath
This commit is contained in:
parent
7a17c43b26
commit
c24a95b7ad
@ -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.'&file='.urlencode(dol_sanitizePathName($relativepath)).($param?'&'.$param:'').'"';
|
||||
$out.= '<a class="documentdownload paddingright" href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($relativepath).($param?'&'.$param:'').'"';
|
||||
$mime=dol_mimetype($relativepath,'',0);
|
||||
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
|
||||
$out.= '>';
|
||||
|
||||
@ -429,7 +429,7 @@ class Product extends CommonObject
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
$this->ref = dol_string_nospecial(trim($this->ref));
|
||||
$this->ref = dol_sanitizeFileName(dol_string_nospecial(trim($this->ref)));
|
||||
$this->label = trim($this->label);
|
||||
$this->price_ttc=price2num($this->price_ttc);
|
||||
$this->price=price2num($this->price);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user