$options = array();
$options['redirection'] = 5;
+ $options['reject_unsafe_urls'] = true;
if ( false == $file_path )
$options['method'] = 'HEAD';
if ( !empty( $deprecated ) )
_deprecated_argument( __FUNCTION__, '2.7' );
- $response = wp_remote_head( $url );
+ $response = wp_remote_head( $url, array( 'reject_unsafe_urls' => true ) );
if ( is_wp_error( $response ) )
return false;
else
$frag = '';
- if ( 0 === stripos( 'http://', $uri ) ) {
+ if ( 0 === stripos( $uri, 'http://' ) ) {
$protocol = 'http://';
$uri = substr( $uri, 7 );
- } elseif ( 0 === stripos( 'https://', $uri ) ) {
+ } elseif ( 0 === stripos( $uri, 'https://' ) ) {
$protocol = 'https://';
$uri = substr( $uri, 8 );
} else {
$options = array();
$options['timeout'] = 10;
+ $options['reject_unsafe_urls'] = true;
$response = wp_remote_get( $uri, $options );
// Allow plugin to filter the output error trigger
if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
- $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
- $message .= ' ' . __( 'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
- trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
+ if ( function_exists( '__' ) ) {
+ $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
+ $message .= ' ' . __( 'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );
+ trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );
+ } else {
+ $version = is_null( $version ) ? '' : sprintf( '(This message was added in version %s.)', $version );
+ $message .= ' Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.';
+ trigger_error( sprintf( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s', $function, $message, $version ) );
+ }
}
}