mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 14:33:14 +00:00
Fix #1156 : Move mime detection hack to application level
This commit is contained in:
@@ -18,8 +18,6 @@ use Silex\ControllerCollection;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
use Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser;
|
||||
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;
|
||||
use Symfony\Component\Serializer\Serializer;
|
||||
|
||||
/**
|
||||
@@ -150,12 +148,6 @@ class Upload implements ControllerProviderInterface
|
||||
*/
|
||||
public function upload(Application $app, Request $request)
|
||||
{
|
||||
$guesser = MimeTypeGuesser::getInstance();
|
||||
/**
|
||||
* temporary hack to use this guesser before fileinfo
|
||||
*/
|
||||
$guesser->register(new FileBinaryMimeTypeGuesser());
|
||||
|
||||
$datas = array(
|
||||
'success' => false,
|
||||
'code' => null,
|
||||
|
@@ -14,6 +14,8 @@ namespace Alchemy\Phrasea;
|
||||
use Alchemy\Phrasea\Core\Configuration;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\File\MimeType\FileBinaryMimeTypeGuesser;
|
||||
use Symfony\Component\HttpFoundation\File\MimeType\MimeTypeGuesser;
|
||||
use Symfony\Component\Serializer;
|
||||
use XPDF\PdfToText;
|
||||
use XPDF\Exception\Exception as XPDFException;
|
||||
@@ -148,6 +150,11 @@ class Core extends \Pimple
|
||||
|
||||
|
||||
$this['mediavorus'] = $this->share(function() {
|
||||
$guesser = MimeTypeGuesser::getInstance();
|
||||
/**
|
||||
* temporary hack to use this guesser before fileinfo
|
||||
*/
|
||||
$guesser->register(new FileBinaryMimeTypeGuesser());
|
||||
|
||||
return new \MediaVorus\MediaVorus();
|
||||
});
|
||||
|
Reference in New Issue
Block a user