mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-22 17:18:32 +01:00
Allow protocol-relative URLs when registering/enqueueing scripts and styles.
props mimecine, TobiasBg, georgestephanis. props kurtpayne for the test coverage. fixes #16560. git-svn-id: http://core.svn.wordpress.org/trunk@21166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cefb69254d
commit
5c228ae869
@ -110,7 +110,7 @@ class WP_Scripts extends WP_Dependencies {
|
||||
}
|
||||
|
||||
$this->print_extra_script( $handle );
|
||||
if ( !preg_match('|^https?://|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
|
||||
if ( !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
|
||||
$src = $this->base_url . $src;
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ class WP_Styles extends WP_Dependencies {
|
||||
}
|
||||
|
||||
function _css_href( $src, $ver, $handle ) {
|
||||
if ( !is_bool($src) && !preg_match('|^https?://|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
|
||||
if ( !is_bool($src) && !preg_match('|^(https?:)?//|', $src) && ! ( $this->content_url && 0 === strpos($src, $this->content_url) ) ) {
|
||||
$src = $this->base_url . $src;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user