2
0
forked from Wavyzz/dolibarr

Fix pb with .svg files

This commit is contained in:
Laurent Destailleur
2017-07-25 23:02:14 +02:00
parent 8b793a261f
commit ab72fbffc6

View File

@@ -2325,7 +2325,7 @@ function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $
if ($pictoisfullpath)
{
// Clean parameters
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
$fullpathpicto = $picto;
}
else
@@ -2346,7 +2346,7 @@ function img_picto($titlealt, $picto, $morealt = '', $pictoisfullpath = false, $
$path = $regs[2]; // $path is $mymodule
}
// Clean parameters
if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png';
if (! preg_match('/(\.png|\.gif|\.svg)$/i',$picto)) $picto .= '.png';
// If alt path are defined, define url where img file is, according to physical path
foreach ($conf->file->dol_document_root as $type => $dirroot) // ex: array(["main"]=>"/home/maindir/htdocs", ["alt0"]=>"/home/moddir0/htdocs", ...)
{