Make WordPress Core

Ticket #24813: 24813.diff

File 24813.diff, 1.2 KB (added by nacin, 13 years ago)
  • wp-includes/class.wp-styles.php

     
    8787
    8888                if ( $this->do_concat ) {
    8989                        $this->print_html .= $tag;
    90                         $this->print_html .= $this->print_inline_style( $handle, false );
     90                        $this->print_html .= sprintf( "<style type='text/css'>\n%s\n</style>\n", $this->print_inline_style( $handle, false ) );
    9191                } else {
    9292                        echo $tag;
    93                         echo $this->print_inline_style( $handle, false );
     93                        $this->print_inline_style( $handle );
    9494                }
    9595
    9696                return true;
  • wp-includes/functions.wp-styles.php

     
    7171                $wp_styles = new WP_Styles();
    7272        }
    7373
     74        if ( false !== stripos( $data, '</style>' ) ) {
     75                _doing_it_wrong( __FUNCTION__, 'Do not pass <style> tags to wp_add_inline_style()', '3.7' );
     76                $data = preg_replace( '<style[^>]*>(.*)</style>i', '$1', $data );
     77        }
     78
    7479        return $wp_styles->add_inline_style( $handle, $data );
    7580}
    7681