Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
24 | public static function fix_url_for_bad_hosts( $url ) { |
||
25 | // If we receive an http url, return it. |
||
26 | if ( 'http' === wp_parse_url( $url, PHP_URL_SCHEME ) ) { |
||
27 | return $url; |
||
28 | } |
||
29 | |||
30 | // If the url should never be https, ensure it isn't https. |
||
31 | if ( 'NEVER' === Constants::get_constant( 'JETPACK_CLIENT__HTTPS' ) ) { |
||
32 | return set_url_scheme( $url, 'http' ); |
||
33 | } |
||
34 | |||
35 | // Otherwise, return the https url. |
||
36 | return $url; |
||
37 | } |
||
38 | } |
||
39 |