Issue Bug Closed

#98330PHP warning log with EXT-syntax using asset vh in BE

Roman Büchler 09/12/22, 09:26 updated 07/09/24, 12:46

Description

*Description*
When using an asset view helper in the backend context referencing a resource from a 3rd party extension a php warning entry is added to the sys_log table. The behavior can be observed when the php configuration `open_basedir` is set and “Live” is selected as debug settings in the configuration presets from the settings module. The warning log entry looks as following:

Core: Error handler (BE): PHP Warning: file_exists(): open_basedir restriction in effect. File(/typo3conf/ext/pizpalue/Sysext/backend/Resources/Public/Css/LayoutModule/collapsible-content-element.css) is not within the allowed path(s): (/home/httpd/vhosts/domain.ch/:/tmp/) in /home/httpd/vhosts/domain.ch/httpdocs/pizpalue/public/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 2317 

*Example use case*
An extension with the extension key myext overwrites the partial `PageLayout/Record.html` from the system extension “backend” and uses an asset view helper in the overriding partial as following:

<f:asset.css identifier="myext-backend" href="EXT:myext/Path/To/Css/custom.css" />

*Findings*
- The log entry can be avoided by adjusting the global configuration `[SYS][belogErrorReporting]`
- When checking for file existence in `GeneralUtility` the `open_basedir` could be checked using `ini_get(‘open_basedir’)` prior using `file_exists()`

Reviews 1