Add .svg, .webp and .webm image formats - refs #5637

1.9.x
Imanol Losada 10 years ago
parent ea56afd52e
commit 21c66bf8e3
  1. 9
      main/inc/lib/main_api.lib.php
  2. 2
      main/inc/lib/social.lib.php
  3. 2
      main/social/home.php

@ -7551,3 +7551,12 @@ function api_get_configuration_value($variable)
}
return false;
}
/**
* Returns supported image extensions
* @return array Supported image extensions
*/
function getSupportedImageExtensions()
{
return array('jpg', 'jpeg', 'png', 'gif', 'svg', 'webp', 'webm');
}

@ -1204,7 +1204,7 @@ class SocialManager extends UserManager
$safeFileName = Database::escape_string($fileAttach['name']);
$extension = strtolower(substr(strrchr($safeFileName, '.'), 1));
$allowedTypes = array('jpg', 'jpeg', 'png', 'gif');
$allowedTypes = getSupportedImageExtensions();
if (!in_array($extension, $allowedTypes)) {
$flag = false;
} else {

@ -44,7 +44,7 @@ if (api_get_setting('profile', 'picture') == 'true') {
get_lang('DelImage')
);
}
$allowed_picture_types = array('jpg', 'jpeg', 'png', 'gif');
$allowed_picture_types = getSupportedImageExtensions();
$form->addRule(
'picture',
get_lang('OnlyImagesAllowed') . ' (' . implode(

Loading…
Cancel
Save