Merge pull request #11229 from frederic34/patch-7

target _blank depend of mime
This commit is contained in:
Laurent Destailleur 2019-05-21 22:42:36 +02:00 committed by GitHub
commit f99f1d83c2
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";