summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube/rcube_utils.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2013-10-26 11:49:02 +0200
committerThomas Bruederli <thomas@roundcube.net>2013-10-26 11:49:02 +0200
commitfdb30f32790857797ae91520995b02316d2d3673 (patch)
treee534c006e76743bd1baaa9e997b0fbef93bfdeac /program/lib/Roundcube/rcube_utils.php
parentf202a7e8b17c5284daf554c2de91a1ec68c76da0 (diff)
Fix CSS selector modifications when nested in @media blocks
Diffstat (limited to 'program/lib/Roundcube/rcube_utils.php')
-rw-r--r--program/lib/Roundcube/rcube_utils.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/program/lib/Roundcube/rcube_utils.php b/program/lib/Roundcube/rcube_utils.php
index b73bc0812..174fe398c 100644
--- a/program/lib/Roundcube/rcube_utils.php
+++ b/program/lib/Roundcube/rcube_utils.php
@@ -454,6 +454,9 @@ class rcube_utils
// cut out all contents between { and }
while (($pos = strpos($source, '{', $last_pos)) && ($pos2 = strpos($source, '}', $pos))) {
+ $nested = strpos($source, '{', $pos+1);
+ if ($nested && $nested < $pos2) // when dealing with nested blocks (e.g. @media), take the inner one
+ $pos = $nested;
$length = $pos2 - $pos - 1;
$styles = substr($source, $pos+1, $length);