|
|
|
@ -456,7 +456,7 @@ class ResourceController extends AbstractResourceController implements CourseCon |
|
|
|
|
/** |
|
|
|
|
* @return mixed|StreamedResponse |
|
|
|
|
*/ |
|
|
|
|
private function processFile(Request $request, ResourceNode $resourceNode, string $mode = 'show', string $filter = '', ?array $allUserInfo = null) |
|
|
|
|
private function processFile(Request $request, ResourceNode $resourceNode, string $mode = 'show', string $filter = '', ?array $allUserInfo = null): mixed |
|
|
|
|
{ |
|
|
|
|
$this->denyAccessUnlessGranted( |
|
|
|
|
ResourceNodeVoter::VIEW, |
|
|
|
@ -554,9 +554,6 @@ class ResourceController extends AbstractResourceController implements CourseCon |
|
|
|
|
$content = str_replace('</head>', $links.'</head>', $content); |
|
|
|
|
} |
|
|
|
|
$response->setContent($content); |
|
|
|
|
/*$contents = $this->renderView('@ChamiloCore/Resource/view_html.twig', [ |
|
|
|
|
'category' => '...', |
|
|
|
|
]);*/ |
|
|
|
|
|
|
|
|
|
return $response; |
|
|
|
|
} |
|
|
|
@ -572,7 +569,9 @@ class ResourceController extends AbstractResourceController implements CourseCon |
|
|
|
|
} |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// Transliterator::transliterate($fileName) |
|
|
|
|
// Convert the file name to ASCII using iconv |
|
|
|
|
$fileName = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $fileName); |
|
|
|
|
|
|
|
|
|
$disposition = $response->headers->makeDisposition( |
|
|
|
|
$forceDownload ? ResponseHeaderBag::DISPOSITION_ATTACHMENT : ResponseHeaderBag::DISPOSITION_INLINE, |
|
|
|
|
$fileName |
|
|
|
|