Bug #84624
closedImporting Youtube Videos with control characters in the title might break frontend output
0%
Description
When a Youtube Video is imported by URL for example with the text/media element the video might throw an exception when displayed in the frontend. The error message can be like this:
You are not allowed to access that file: "Einfach_Energie_sparen_–_Tipp_1_–_Richtig_Heizen_und_Lüften.youtube"
This maybe caused by inproper sanitizing of the filename during the import. When the video is imported the title of the video might be retrieved (@see AbstractOEmbedHelper::transformMediaIdToFile()) and used as part of the filename. The title can contain characters like "–". When creating the file LocalDriver:.addFile() is used where the sanitization of the later filename takes place. Inside of LocalDriver::sanitizeFileName() it's checked if $GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem'] is true. If not than control characters like "–" are replaced otherwise they are left untouched as they should not cause problems. When the file get's retrieved in the frontend the permissions to read that file get checked. During this check in ResourceStorage::checkFileActionPermission() the file extension is checked with GeneralUtility::verifyFilenameAgainstDenyPattern(). At this point control characters like "–" are not allowed which leads to the exception.
A workaround could be to set GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem'] to false as the filename won't contain control characters in that case. I think a better solution would be to replace control characters during the import or change the behaiviour of GeneralUtility::verifyFilenameAgainstDenyPattern
Example video with control characters in the filename: https://www.youtube.com/watch?v=SlXSjcWp8hE
Updated by Guido Schmechel over 6 years ago
Hi Hannes,
can you please recheck this video with 8.7.13 or 9.3-dev and give some feedback? I can't reproduce your issue with these versions and video.
Updated by Riccardo De Contardi about 6 years ago
- Status changed from New to Needs Feedback
Updated by Wouter Wolters almost 6 years ago
- Status changed from Needs Feedback to Closed
No feedback for a couple of months, closing this issue for now. If this is still a problem please contact me and I will re-open it.