modifié:         core/lib/Thelia/Controller/Admin/FileController.php
	modifié:         core/lib/Thelia/Tests/Tools/MimeTypesToolsTest.php
	modifié:         core/lib/Thelia/Tools/MimeTypeTools.php
This commit is contained in:
Benjamin Perche
2014-07-28 11:19:57 +02:00
parent 4b2ee0d357
commit d1a9115626
3 changed files with 14 additions and 13 deletions

View File

@@ -10,7 +10,7 @@
/* file that was distributed with this source code. */ /* file that was distributed with this source code. */
/*************************************************************************************/ /*************************************************************************************/
namespace Thelia\Tests\Type; namespace Thelia\Tests\Tools;
use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Container;
use Thelia\Core\Translation\Translator; use Thelia\Core\Translation\Translator;
use Thelia\Tools\MimeTypeTools; use Thelia\Tools\MimeTypeTools;

View File

@@ -65,7 +65,8 @@ class MimeTypeTools
* @param $fileName * @param $fileName
* @return bool * @return bool
*/ */
public function validateMimeTypeExtension($mimeType, $fileName) { public function validateMimeTypeExtension($mimeType, $fileName)
{
$mimeType = strtolower($mimeType); $mimeType = strtolower($mimeType);
$extensions = $this->guessExtensionsFromMimeType($mimeType); $extensions = $this->guessExtensionsFromMimeType($mimeType);
@@ -79,7 +80,7 @@ class MimeTypeTools
$oneMatch &= !!preg_match("#\.$extension$#i", $fileName); $oneMatch &= !!preg_match("#\.$extension$#i", $fileName);
} }
return (bool)$oneMatch ? static::TYPE_MATCH : static::TYPE_NOT_MATCH; return (bool) $oneMatch ? static::TYPE_MATCH : static::TYPE_NOT_MATCH;
} }
/** /**