mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Deprecate url_is_accessable_via_ssl(). Fixes #19555. Props jgadbois.
git-svn-id: https://develop.svn.wordpress.org/trunk@28709 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -3001,41 +3001,6 @@ function absint( $maybeint ) {
|
||||
return abs( intval( $maybeint ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the blog can be accessed over SSL.
|
||||
*
|
||||
* Determines if blog can be accessed over SSL by using cURL to access the site
|
||||
* using the https in the siteurl. Requires cURL extension to work correctly.
|
||||
*
|
||||
* @since 2.5.0
|
||||
*
|
||||
* @param string $url
|
||||
* @return bool Whether SSL access is available
|
||||
*/
|
||||
function url_is_accessable_via_ssl($url)
|
||||
{
|
||||
if ( in_array( 'curl', get_loaded_extensions() ) ) {
|
||||
$ssl = set_url_scheme( $url, 'https' );
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $ssl);
|
||||
curl_setopt($ch, CURLOPT_FAILONERROR, true);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
|
||||
|
||||
curl_exec($ch);
|
||||
|
||||
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close ($ch);
|
||||
|
||||
if ($status == 200 || $status == 401) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Marks a function as deprecated and informs when it has been used.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user