contao/import — Issue #3634: Stylesheets.php incorrect handling of border-radius
Author: importer
Created: 2011-11-29 21:54:15+00:00
State: open
Labels: backend, Defect

the following rule is incorrectly handled when 0 is used as the first value (unit-less):

border-radius:0 6px 0 0;

due to line 1767 of Stylesheets.php:

$strUnit = preg_replace('/[^ceimnptx%]/', '', $arrTRBL[0]);

which assumes that the units will be on the first item.

additionally this fix will not work:

border-radius:0px 6px 0 0;

due to line 802 of Stylesheets.php:

$borderradius .= $top . (($top === '0') ? '' : $row['borderradius']['unit']) . ' ' . $right . (($right === '0') ? '' : $row['borderradius']['unit']) . ' ' . $bottom . (($bottom === '0') ? '' : $row['borderradius']['unit']) . ' ' . $left . (($left === '0') ? '' : $row['borderradius']['unit']) . ';';

which does not apply units to 0 values when writing the css to a file.

Therefore if using an extension like: csseditor (http://www.contao.org/extension-list/view/csseditor.20050009.en.html)

then the 2nd time the css rules are saved the problem reoccurs.

There is code higher up in the file which correctly handles padding and margin, this code could be reused for border-radius

--- _Originally created by wal5hy on November 14th, 2011, at 10:31pm (ID 3634)_