Bug #88365

<style> element in fluid templates breaks output since PHP 7.3.5

Added by Patrick no-lastname-given 4 months ago. Updated 4 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2019-05-15
Due date:
% Done:

0%

TYPO3 Version:
8
PHP Version:
7.3
Tags:
php73
Complexity:
Is Regression:
Sprint Focus:

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

History

#1 Updated by Thomas Hohn 4 months 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.

#2 Updated by Patrick no-lastname-given 4 months ago

7.3.5 yes

#3 Updated by Thomas Hohn 4 months 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.

#4 Updated by Oliver Hader 4 months ago

  • Tags set to php73

#5 Updated by Patrick no-lastname-given 4 months 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

#6 Updated by Patrick no-lastname-given 4 months ago

  • Description updated (diff)

#7 Updated by Patrick no-lastname-given 4 months ago

  • Description updated (diff)

#8 Updated by Benni Mack 4 months 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

#9 Updated by Rasmus Larsen 4 months 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.

Also available in: Atom PDF