Make WordPress Core


Ignore:
Timestamp:
06/09/2014 10:02:50 PM (10 years ago)
Author:
johnbillion
Message:

Deprecate url_is_accessable_via_ssl(). Fixes #19555. Props jgadbois.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r28648 r28709  
    30033003
    30043004/**
    3005  * Determines if the blog can be accessed over SSL.
    3006  *
    3007  * Determines if blog can be accessed over SSL by using cURL to access the site
    3008  * using the https in the siteurl. Requires cURL extension to work correctly.
    3009  *
    3010  * @since 2.5.0
    3011  *
    3012  * @param string $url
    3013  * @return bool Whether SSL access is available
    3014  */
    3015 function url_is_accessable_via_ssl($url)
    3016 {
    3017     if ( in_array( 'curl', get_loaded_extensions() ) ) {
    3018         $ssl = set_url_scheme( $url, 'https' );
    3019 
    3020         $ch = curl_init();
    3021         curl_setopt($ch, CURLOPT_URL, $ssl);
    3022         curl_setopt($ch, CURLOPT_FAILONERROR, true);
    3023         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    3024         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    3025         curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
    3026 
    3027         curl_exec($ch);
    3028 
    3029         $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    3030         curl_close ($ch);
    3031 
    3032         if ($status == 200 || $status == 401) {
    3033             return true;
    3034         }
    3035     }
    3036     return false;
    3037 }
    3038 
    3039 /**
    30403005 * Marks a function as deprecated and informs when it has been used.
    30413006 *
Note: See TracChangeset for help on using the changeset viewer.