Make WordPress Core

Ticket #48074: 48074-src-Remove-work-arounds-for-CURLOPT_PROTOCOLS.patch

File 48074-src-Remove-work-arounds-for-CURLOPT_PROTOCOLS.patch, 1.0 KB (added by jrf, 5 years ago)

The CURLOPT_PROTOCOLS constant was introduced in PHP 5.2.10, so no longer needs a work-around. See: https://www.php.net/manual/en/function.curl-setopt.php

  • src/wp-includes/class-wp-http-curl.php

    From 30e0a5326f8112a64eb86e9a093362e55e3d1423 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Sat, 27 Jul 2019 04:31:48 +0200
    Subject: [PATCH] [src] Remove work-arounds for CURLOPT_PROTOCOLS
    
    ---
     src/wp-includes/class-wp-http-curl.php | 4 +---
     1 file changed, 1 insertion(+), 3 deletions(-)
    
    diff --git a/src/wp-includes/class-wp-http-curl.php b/src/wp-includes/class-wp-http-curl.php
    index c331f05d88..a49db80fbb 100644
    a b class WP_Http_Curl { 
    143143                 * a bug #17490 with redirected POST requests, so handle redirections outside Curl.
    144144                 */
    145145                curl_setopt( $handle, CURLOPT_FOLLOWLOCATION, false );
    146                 if ( defined( 'CURLOPT_PROTOCOLS' ) ) { // PHP 5.2.10 / cURL 7.19.4
    147                         curl_setopt( $handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );
    148                 }
     146                curl_setopt( $handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );
    149147
    150148                switch ( $parsed_args['method'] ) {
    151149                        case 'HEAD':