2
0
forked from Wavyzz/dolibarr

FIX Disable svg as supported image by default. Set

MAIN_ALLOW_SVG_FILES_AS_IMAGES to 1 to have svg working.
This commit is contained in:
Laurent Destailleur
2020-08-06 12:29:57 +02:00
parent 01babc452c
commit c6ee80eefd
3 changed files with 8 additions and 2 deletions

View File

@@ -37,7 +37,12 @@ $quality = 80;
*/
function image_format_supported($file)
{
$regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm|\.svg'; // See also into product.class.php
global $conf;
$regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into product.class.php
if (! empty($conf->global->MAIN_ALLOW_PREVIEW_OF_UPLOADED_SVG_FILES)) {
$regeximgext .= '|\.svg'; // Not allowed by default. SVG can contains javascript
}
// Case filename is not a format image
$reg = array();