Project

General

Profile

Actions

Bug #99926

closed

PHP Warning when file does not exists.

Added by JAKOTA Design Group GmbH almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2023-02-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #100048: Ensure that getFileContents returns correct type in YamlFileLoaderClosedThomas Hohn2023-02-28

Actions
Actions

Also available in: Atom PDF