tubalmartin / YUI-CSS-compressor-PHP-port

A PHP port of the YUI CSS compressor.
230 stars 34 forks source link

background{0 0} becomes background{0}? #24

Closed futtta closed 7 years ago

futtta commented 9 years ago

a{background:0 0} becomes a{background:0}

fix could be to change line 357 from $css = preg_replace('/(background\-position|webkit-mask-position|(?:webkit|moz|o|ms|)\-?transform\-origin)\:0(;|\}| \!)/iS', '$1:0 0$2', $css); into $css = preg_replace('/(background|background\-position|webkit-mask-position|(?:webkit|moz|o|ms|)\-?transform\-origin)\:0(;|\}| \!)/iS', '$1:0 0$2', $css);

frank

mikeytown2 commented 9 years ago

Shouldn't more regex control characters be escaped; not less?

Before:
$css = preg_replace('/(background\-position|webkit-mask-position|(?:webkit|moz|o|ms|)\-?transform\-origin)\:0(;|\}| \!)/iS', '$1:0 0$2', $css);

After:
$css = preg_replace('/(background|background\-position|webkit\-mask\-position|(?:webkit|moz|o|ms|)\-?transform\-origin)\:0(;|\}| \!)/iS', '$1:0 0$2', $css);

futtta commented 9 years ago

Had some issues with markdown, so some backslashes escaped ;-)

anyway, it now is how I meant it to be. questions remains whether webkit-mask-position needs escaping, but I'll leave that to @tubalmartin, he should know ;-)

tubalmartin commented 7 years ago

Fixed in v2.4.8-p7 release. Thank you guys!