diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-22 05:22:43 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-11-22 05:22:43 +0000 |
commit | bf2c1934b971e62d8a424928b86fb6785212df78 (patch) | |
tree | bb915c4381c6974f480a210ec59b5f8a4549a8e1 /includes | |
parent | 61fc4b0b32dbb354d675e58b6c95305f52c3f553 (diff) | |
download | brdo-bf2c1934b971e62d8a424928b86fb6785212df78.tar.gz brdo-bf2c1934b971e62d8a424928b86fb6785212df78.tar.bz2 |
#672954 by effulgentsia, Jacine: Fixed Wrap inline CSS with explicit CDATA
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc index acc65af5f..f1b153781 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -3152,6 +3152,12 @@ function drupal_pre_render_styles($elements) { // URL changed. $query_string = variable_get('css_js_query_string', '0'); + // For inline CSS to validate as XHTML, all CSS containing XHTML needs to be + // wrapped in CDATA. To make that backwards compatible with HTML 4, we need to + // comment out the CDATA-tag. + $embed_prefix = "\n<!--/*--><![CDATA[/*><!--*/\n"; + $embed_suffix = "\n/*]]>*/-->\n"; + // Defaults for LINK and STYLE elements. $link_element_defaults = array( '#type' => 'html_tag', @@ -3259,6 +3265,8 @@ function drupal_pre_render_styles($elements) { if (isset($group['data'])) { $element = $style_element_defaults; $element['#value'] = $group['data']; + $element['#value_prefix'] = $embed_prefix; + $element['#value_suffix'] = $embed_suffix; $element['#attributes']['media'] = $group['media']; $element['#browsers'] = $group['browsers']; $elements[] = $element; @@ -3267,6 +3275,8 @@ function drupal_pre_render_styles($elements) { foreach ($group['items'] as $item) { $element = $style_element_defaults; $element['#value'] = $item['data']; + $element['#value_prefix'] = $embed_prefix; + $element['#value_suffix'] = $embed_suffix; $element['#attributes']['media'] = $item['media']; $element['#browsers'] = $group['browsers']; $elements[] = $element; |