Changeset 37922
- Timestamp:
- 06/29/2016 09:04:25 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r37920 r37922 2822 2822 2823 2823 if ( in_array( $relation_type, array( 'preconnect', 'dns-prefetch' ) ) ) { 2824 $parsed = parse_url( $url ); 2824 $parsed = wp_parse_url( $url ); 2825 if ( empty( $parsed['host'] ) ) { 2826 continue; 2827 } 2825 2828 2826 2829 if ( ! empty( $parsed['scheme'] ) ) { … … 2848 2851 if ( is_object( $wp_scripts ) && ! empty( $wp_scripts->registered ) ) { 2849 2852 foreach ( $wp_scripts->registered as $registered_script ) { 2850 $src = $registered_script->src; 2851 // Make sure the URL has a scheme, otherwise parse_url() could fail to pass the host. 2852 if ( '//' == substr( $src, 0, 2 ) ) { 2853 $src = set_url_scheme( $src ); 2854 } 2855 2856 $this_host = parse_url( $src, PHP_URL_HOST ); 2857 if ( ! empty( $this_host ) && ! in_array( $this_host, $unique_hosts ) && $this_host !== $_SERVER['SERVER_NAME'] ) { 2858 $unique_hosts[] = $this_host; 2853 $parsed = wp_parse_url( $registered_script->src ); 2854 2855 if ( ! empty( $parsed['host'] ) && ! in_array( $parsed['host'], $unique_hosts ) && $parsed['host'] !== $_SERVER['SERVER_NAME'] ) { 2856 $unique_hosts[] = $parsed['host']; 2859 2857 } 2860 2858 } … … 2863 2861 if ( is_object( $wp_styles ) && ! empty( $wp_styles->registered ) ) { 2864 2862 foreach ( $wp_styles->registered as $registered_style ) { 2865 $src = $registered_style->src; 2866 // Make sure the URL has a scheme, otherwise parse_url() could fail to pass the host. 2867 if ( '//' == substr( $src, 0, 2 ) ) { 2868 $src = set_url_scheme( $src ); 2869 } 2870 2871 $this_host = parse_url( $src, PHP_URL_HOST ); 2872 if ( ! empty( $this_host ) && ! in_array( $this_host, $unique_hosts ) && $this_host !== $_SERVER['SERVER_NAME'] ) { 2873 $unique_hosts[] = $this_host; 2863 $parsed = wp_parse_url( $registered_style->src ); 2864 2865 if ( ! empty( $parsed['host'] ) && ! in_array( $parsed['host'], $unique_hosts ) && $parsed['host'] !== $_SERVER['SERVER_NAME'] ) { 2866 $unique_hosts[] = $parsed['host']; 2874 2867 } 2875 2868 }
Note: See TracChangeset
for help on using the changeset viewer.