#99926PHP Warning when file does not exists.
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
Reviews 2
Related issues 1
History 610
-
JAKOTA Design Group GmbH changed description 02/10/23, 14:54
-
JAKOTA Design Group GmbH commented 02/27/23, 22:01
-
Gerrit Code Review pushed patch set 1 for main to change 77978 status
NewUnder Review 02/28/23, 09:08 -
Gerrit Code Review pushed patch set 2 for main to change 77978 02/28/23, 13:50
-
Thomas Hohn changed assigned to Thomas Hohn 02/28/23, 19:38
-
Gerrit Code Review pushed patch set 3 for main to change 77978 02/28/23, 20:09
-
Simon Schaufelberger changed Related to #100048 03/01/23, 00:03
-
Gerrit Code Review pushed patch set 1 for 11.5 to change 77989 03/01/23, 11:26
-
Thomas Hohn commented and changed status
Under ReviewResolved done0 %100 % 03/01/23, 11:55Applied in changeset commit:ecfd80be34be8f49a5fc770974e4b807b5bac9bf.
-
Benni Mack changed status
ResolvedClosed 03/14/23, 11:47
Sure. If that is the case, I’m all for it.