target _blank depend of mime

target _blank is added in the previous line depending on mimtype
This commit is contained in:
Frédéric FRANCE 2019-05-21 13:11:17 +02:00 committed by GitHub
parent ea5ffbb0bf
commit 84781cabac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -761,7 +761,7 @@ class FormFile
$out.= '<a class="documentdownload paddingright" href="'.$documenturl.'?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).($param?'&'.$param:'').'"';
$mime=dol_mimetype($relativepath,'',0);
if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
$out.= ' target="_blank">';
$out.= '>';
$out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]);
$out.= dol_trunc($file["name"], 150);
$out.= '</a>'."\n";