Bug #62463

bug in compressing the css-files!?

Added by Kurt Kunig over 5 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2014-10-25
Due date:
% Done:

100%

TYPO3 Version:
6.2
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

TYPO3 V6.2 maybe a bug in compressing the css-files!?

e.g.: A css3 parameter like width: calc(100% + 16px); does not appear in the compressed CSS-file when config.compressCss is set to 1!

Setting the parameter to config.compressCss = 0, the "calc"-item will be there!


Related issues

Related to TYPO3 Core - Bug #64950: Regex in RessourceCompressor triggers PHP segfault with old pcre versions Closed 2015-02-09
Related to TYPO3 Core - Bug #69309: config.compressCss breaks CSS3 calc() value Closed 2015-08-25
Related to TYPO3 Core - Bug #69648: Built-in css minification destroys certain CSS constructs Closed 2015-09-10
Duplicated by TYPO3 Core - Bug #78361: bug in compressing the css-files again Rejected 2016-10-20

Associated revisions

Revision 3e367ca1 (diff)
Added by Christian Futterlieb about 5 years ago

[BUGFIX] CSS3 function calc must retain whitespace

Whitespaces within CSS3 function 'calc' must not be stripped
because otherwise browsers won't recognize it anymore.

Although the CSS3 specification requires the whitespaces around
the additive expressions (+/-) only, it might be better to not
remove any whitespace within a calc function in terms of
simplicity.. the minifying is complex enough as it already is.

Resolves: #62463
Releases: master, 6.2
Change-Id: Ied0c02e132aafa97ce9fb6b0e9930898cb17efc1
Reviewed-on: http://review.typo3.org/35366
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Mathias Schreiber <>
Tested-by: Mathias Schreiber <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

Revision 5cfb009d (diff)
Added by Christian Futterlieb about 5 years ago

[BUGFIX] CSS3 function calc must retain whitespace

Whitespaces within CSS3 function 'calc' must not be stripped
because otherwise browsers won't recognize it anymore.

Although the CSS3 specification requires the whitespaces around
the additive expressions (+/-) only, it might be better to not
remove any whitespace within a calc function in terms of
simplicity.. the minifying is complex enough as it already is.

Resolves: #62463
Releases: master, 6.2
Change-Id: Ied0c02e132aafa97ce9fb6b0e9930898cb17efc1
Reviewed-on: http://review.typo3.org/34180
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>

Revision ec1b5d7c (diff)
Added by Christian Kuhn about 5 years ago

Revert "[BUGFIX] CSS3 function calc must retain whitespace"

This reverts commit 5cfb009da9b36fc022aec19a57dc6965ff80a9ff.

The change introduced a huge regex that leads to PHP segfaults
with old PCRE versions that are usually bundled with PHP versions
5.3 and 5.4. A test script link was added to the forge issue.

The patch reverts the patch for issue #62463 for 6.2 while
master will receive an install tool check for recent PCRE versions.

Change-Id: I63b4ff282ecac34730eef52c4127ad7acfb8dbba
Resolves: #64950
Reverts: #62463
Releases: 6.2
Reviewed-on: http://review.typo3.org/36783
Reviewed-by: Stephan Großberndt <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 0dec92bf (diff)
Added by Stephan Großberndt about 5 years ago

[TASK] Check PCRE version in SystemEnvironment/Check

Certain regular expressions passed to PCRE library < 8.30
can trigger a PHP segfault. This patch introduces an additional
system environment check to verify the PCRE version is

= 8.30 (default shipped with PHP 5.5).

Resolves: #64950
Related: #62463
Releases: master
Change-Id: I3725c67f2b8e99941f0c6eb82a64d646025a1b85
Reviewed-on: http://review.typo3.org/36784
Reviewed-by: Stephan Großberndt <>
Reviewed-by: Wouter Wolters <>
Tested-by: Wouter Wolters <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision b47d65e9 (diff)
Added by Andreas Fernandez over 4 years ago

[TASK] Update CSS compressor

The old CSS compressor had some issues with certain CSS definitions.
Update the optimizer from upstream and deprecate the
compressCssPregCallback method.

Resolves: #63974
Related: #62463, #60675
Releases: master
Change-Id: Ibe37b902aafd41685042e37485623531e3e8e46c
Reviewed-on: http://review.typo3.org/35565
Reviewed-by: Markus Klein <>
Tested-by: Markus Klein <>
Reviewed-by: Stefan Neufeind <>
Tested-by: Stefan Neufeind <>

History

#1 Updated by Christian Futterlieb over 5 years ago

I experienced similar behaviour with following difference: the compressor removes the whitespaces, which results in an invalid rule:

width: calc(100% + 16px);

becomes:
width: calc(100%+16px);

But "+" and "-" must be wrapped with whitespaces: http://www.w3.org/TR/2006/WD-css3-values-20060919/#calc

I digged around in the compressor and will push a possible solution

#2 Updated by Gerrit Code Review over 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34180

#3 Updated by Gerrit Code Review about 5 years ago

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35366

#4 Updated by Gerrit Code Review about 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35366

#5 Updated by Gerrit Code Review about 5 years ago

Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/34180

#6 Updated by Christian Futterlieb about 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#7 Updated by Christian Kuhn about 5 years ago

This patch leads to PHP segfaults on PHP versions with older PCRE versions. It will be reverted in #64950 for 6.2 for now, and master will get a PCRE version check in install tool.

Please see the related issue for more details.

This patch could potentially be fixed again in 6.2 if a regex can be found that does not crash php ...

#8 Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF