Bug #99926
closedPHP Warning when file does not exists.
100%
Description
Hi
PHP Warning: file_get_contents(/var/www/public/fileadmin/media/user_upload/video.youtube): Failed to open stream: No such file or directory in /var/www/public/typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php line 1359
Steps to reproduce:
1. add a youtube video as content element
2. delete the .youtube file from upload folder
3. open page in frontend
LocalDriver.php should check if a file is readable before reading it.
LocalDriver.php line 1359
From:
return file_get_contents($filePath);
To;
return is_readable($filePath) ? file_get_contents($filePath) : '';
Or maybe this check is better suited elsewhere?!
Thanks
Updated by JAKOTA Design Group GmbH almost 2 years ago
- Description updated (diff)
Updated by JAKOTA Design Group GmbH over 1 year ago
Sure. If that is the case, I'm all for it.
Updated by Gerrit Code Review over 1 year ago
- Status changed from New to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77978
Updated by Gerrit Code Review over 1 year ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77978
Updated by Gerrit Code Review over 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77978
Updated by Simon Schaufelberger over 1 year ago
- Related to Task #100048: Ensure that getFileContents returns correct type in YamlFileLoader added
Updated by Gerrit Code Review over 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77989
Updated by Thomas Hohn over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ecfd80be34be8f49a5fc770974e4b807b5bac9bf.