Introduce `is_https_url()` for testing whether the scheme for a given URL is `https`. See #28487.

Built from https://develop.svn.wordpress.org/trunk@28894


git-svn-id: http://core.svn.wordpress.org/trunk@28693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2014-06-29 11:32:15 +00:00
parent 3f1c3dd4ca
commit de664966b0
1 changed files with 12 additions and 0 deletions

View File

@ -3359,6 +3359,18 @@ function is_ssl() {
return false;
}
/**
* Determine if the scheme of the given URL is https.
*
* @since 4.0.0
*
* @param string $url The URL
* @return boolean True if the given URL uses https, false if not (or if the URL is not valid).
*/
function is_https_url( $url ) {
return ( 'https' === parse_url( $url, PHP_URL_SCHEME ) );
}
/**
* Whether SSL login should be forced.
*