From fdb30f32790857797ae91520995b02316d2d3673 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Sat, 26 Oct 2013 11:49:02 +0200 Subject: Fix CSS selector modifications when nested in @media blocks --- program/lib/Roundcube/rcube_utils.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'program/lib/Roundcube/rcube_utils.php') 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); -- cgit v1.2.3