a-r-m-i-n / dce

TYPO3 CMS Extension. Best FlexForm based content elements since 2012. With TCA mapping feature, simple backend view and much more features which makes it super easy to create own content element types.
12 stars 19 forks source link

Error log flood: "open_basedir restriction... CodeEditor.css" #119

Closed w010 closed 2 months ago

w010 commented 2 months ago

Versions

Problem: I found my system log being flooded with such entries about open_basedir:

Thu, 04 Jul 2024 13:16:50 +0200 [WARNING] request="43225b9d514da" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (BE): PHP Warning: file_exists(): open_basedir restriction in effect. File(/_assets/48a6744cd8d264a8e373db909f09d901/Css/CodeEditor.css) is not within the allowed path(s): (/home/webserver/nnnnnnn.com/www/:/home/webserver/nnnnnnn.com/temp/:/usr/bin/:/usr/share/php/) in /home/webserver/nnnnnnn.com/www/de/releases/67/vendor/typo3/cms-core/Classes/Utility/GeneralUtility.php line 2181

Backtrace shows that it happens somehow in DceCodeMirrorFieldRenderType object, when calling PathUtility::getPublicResourceWebPath('EXT:dce/Resources/Public/Css/CodeEditor.css'); in line 47. Description of TYPO3\CMS\Core\Utility::getPublicResourceWebPath() method says:

"This method should not be used for now except for TYPO3 core. It may be removed or be changed any time"

Probably this method call should be replaced with something modern dedicated for 12.x, unfortunately I don't know what and I can't google anything. It looks like the webroot prefix is missing in the path, before /_assets/. Or maybe the issue is caused by something else, like server settings, or bad composer configuration?

a-r-m-i-n commented 2 months ago

Hey, to fix your issue (I wasn't able to reconstruct this issue, but my "open_basedir" option is not set in PHP) I've moved the CSS contents to inline styles.