Skip to content

Commit

Permalink
fix: do not corrupt CSS4 rgb values
Browse files Browse the repository at this point in the history
Refs: #81
  • Loading branch information
Cerdic committed Sep 20, 2023
1 parent 5e07270 commit 5e5efaa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion class.csstidy_optimise.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,10 @@ public function cut_color($color) {
}

// rgb(0,0,0) -> #000000 (or #000 in this case later)
if (strncasecmp($color, 'rgb(', 4)==0) {
if (strncasecmp($color, 'rgb(', 4)==0
// be sure to not corrupt a CSS4 rgb value
and strpos($color, ',') !== false and strpos($color, '/') === false
) {
$color_tmp = substr($color, 4, strlen($color) - 5);
$color_tmp = explode(',', $color_tmp);
for ($i = 0; $i < count($color_tmp); $i++) {
Expand Down

0 comments on commit 5e5efaa

Please sign in to comment.