Make WordPress Core


Ignore:
Timestamp:
06/09/2014 10:02:50 PM (11 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/deprecated.php

    r28679 r28709  
    34583458    return $content;
    34593459}
     3460
     3461/**
     3462 * Determines if the URL can be accessed over SSL.
     3463 *
     3464 * Determines if the URL can be accessed over SSL by using the WordPress HTTP API to access
     3465 * the URL using https as the scheme.
     3466 *
     3467 * @since 2.5.0
     3468 * @deprecated 4.0.0
     3469 *
     3470 * @param string $url The URL to test.
     3471 * @return bool Whether SSL access is available.
     3472 */
     3473function url_is_accessable_via_ssl( $url ) {
     3474    _deprecated_function( __FUNCTION__, '4.0', '' );
     3475
     3476    $response = wp_remote_get( set_url_scheme( $url, 'https' ) );
     3477
     3478    if ( !is_wp_error( $response ) ) {
     3479        $status = wp_remote_retrieve_response_code( $response );
     3480        if ( 200 == $status || 401 == $status ) {
     3481            return true;
     3482        }
     3483    }
     3484
     3485    return false;
     3486}
Note: See TracChangeset for help on using the changeset viewer.