From f7aef5b69a84ade5a54a256ab434e86fa9f136a3 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 3 Jan 2015 04:10:21 +0000 Subject: [PATCH] Ensure that inline styles attached to conditional stylesheets are also conditional. Adds unit test. Props georgestephanis. Fixes #29180. Built from https://develop.svn.wordpress.org/trunk@31031 git-svn-id: http://core.svn.wordpress.org/trunk@31012 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class.wp-styles.php | 13 ++++++++++--- wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php index eb160670ca..46cb913bd3 100644 --- a/wp-includes/class.wp-styles.php +++ b/wp-includes/class.wp-styles.php @@ -107,17 +107,24 @@ class WP_Styles extends WP_Dependencies { } } - if ( isset($obj->extra['conditional']) && $obj->extra['conditional'] ) { - $tag = "\n"; + $conditional_pre = $conditional_post = ''; + if ( isset( $obj->extra['conditional'] ) && $obj->extra['conditional'] ) { + $conditional_pre = "\n"; } if ( $this->do_concat ) { + $this->print_html .= $conditional_pre; $this->print_html .= $tag; - if ( $inline_style = $this->print_inline_style( $handle, false ) ) + if ( $inline_style = $this->print_inline_style( $handle, false ) ) { $this->print_html .= sprintf( "\n", esc_attr( $handle ), $inline_style ); + } + $this->print_html .= $conditional_post; } else { + echo $conditional_pre; echo $tag; $this->print_inline_style( $handle ); + echo $conditional_post; } return true; diff --git a/wp-includes/version.php b/wp-includes/version.php index 66b467e302..24b6b29429 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31030'; +$wp_version = '4.2-alpha-31031'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.