Make WordPress Core

Ticket #16560: 16560.diff

File 16560.diff, 1.1 KB (added by georgestephanis, 13 years ago)

Allowing styles and scripts to be referenced by http:// https:// and

  • wp-includes/class.wp-styles.php

     
    135135        }
    136136
    137137        function _css_href( $src, $ver, $handle ) {
    138                 if ( !is_bool($src) && !preg_match('|^https?://|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
     138                if ( !is_bool($src) && !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
    139139                        $src = $this->base_url . $src;
    140140                }
    141141
  • wp-includes/class.wp-scripts.php

     
    112112                }
    113113
    114114                $this->print_extra_script( $handle );
    115                 if ( !preg_match('|^https?://|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
     115                if ( !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
    116116                        $src = $this->base_url . $src;
    117117                }
    118118