Bug #88365
closed<style> element in fluid templates breaks output since PHP 7.3.5
0%
Description
With PHP 7.3.5 the frontend and mail output is broken and a php warning in the backend log is shown, if the <style> element is used in fluid templates or layouts.
I use the <style> element in some plugin fluid templates (ext:powermail), with PHP 7.3.5 the frontend output is broken.
I also use the <style> element in some plugin fluid layouts for mails (ext:powermail), with PHP 7.3.5 the mail output is broken. After each form submit, the following two warnings are shown in the backend log:
Core: Error handler (FE): PHP Warning: Invalid argument supplied for foreach() in /<REMOVED>/vendor/typo3fluid/fluid/src/Core/Parser/TemplateParser.php line 591 Core: Error handler (FE): PHP Warning: Invalid argument supplied for foreach() in /<REMOVED>/vendor/typo3fluid/fluid/src/Core/Parser/TemplateProcessor/NamespaceDetectionTemplateProcessor.php line 180
Temporary fix: Moving styles from the <style> element in the fluid templates to a external file and remove the <style> rules to (only) inline styles in the fluid mail layouts.
I don't think this is a issue of ext:powermail, because this issue: https://github.com/TYPO3/Fluid/issues/452
Updated by Thomas Hohn over 5 years ago
Patrick no-lastname-given wrote:
Since the security release 8.7.25 the frontend and mail output is broken and a php warning in the backend log is shown, if the <style> element is used in fluid templates or layouts.
I use the <style> element in some plugin fluid templates (ext:powermail), since 8.7.25 the frontend output is broken.
I also use the <style> element in some plugin fluid layouts for mails (ext:powermail), since 8.7.25 the mail output is broken. After each form submit, the following two warnings are shown in the backend log:
[...]It apears only on remote linux server, not on local windows test machine!
Temporary fix: Moving styles from the <style> element in the fluid templates to a external file and remove the <style> rules to (only) inline styles in the fluid mail layouts.
I don't think this is a issue of ext:powermail, because this issue: https://github.com/TYPO3/Fluid/issues/452
Just out of curiosity - which exact PHP version are you using? Is it PHP 7.3.5/7.3.4 - if so it seems to be a change in the reg exp processing between PHP 7.3.3 and PHP 7.3.5
that causes this bug to arise now.
Updated by Thomas Hohn over 5 years ago
Patrick no-lastname-given wrote:
7.3.5 yes
It's a race condition caused by 7.3.5 changes in preg_split. I have 8.7.25 running with 7.3.3 - upgrading to 7.3.5 made a couple of FLUID template raise that error.
Updated by Patrick Lenk over 5 years ago
- Subject changed from <style> element in fluid templates breaks output since 8.7.25 to <style> element in fluid templates breaks output since PHP 7.3.5
Updated by Benni Mack over 5 years ago
Can anybody confirm that PHP 7.3.4 still works?
This seems to be the change related:
https://bugs.php.net/bug.php?id=77827
https://www.php.net/ChangeLog-7.php#7.3.5
Updated by Rasmus Larsen over 5 years ago
I can confirm that the following build doesn't trigger the issue for us:
PHP 7.3.4-1+ubuntu18.04.1+deb.sury.org+3 (cli) (built: Apr 10 2019 10:51:11) ( NTS )
Upgrading to PHP 7.3.5 triggers the issue for us.
Updated by Benni Mack almost 5 years ago
- Status changed from New to Needs Feedback
Does the issue still exist in TYPO3 v9.5.13?
Updated by Patrick Lenk almost 5 years ago
Benni Mack wrote:
Does the issue still exist in TYPO3 v9.5.13?
With TYPO3 9.5.13 i can not reproduce that error messages or a broken frontend.
The only thing that still broke the output are mail layouts that contains @media rules in the style tag.
Updated by Benni Mack over 4 years ago
- Status changed from Needs Feedback to Closed
Closing this one - no feedback after 90 days. If you feel this is still an issue, leave a comment so I can re-open the issue.