WordPress.org

Make WordPress Core

Ticket #37700: 37700.patch

File 37700.patch, 1.0 KB (added by pross, 3 years ago)
  • wp-includes/Requests/Transport/cURL.php

    diff --git a/wp-includes/Requests/Transport/cURL.php b/wp-includes/Requests/Transport/cURL.php
    index 453f73b..33eeb64 100644
    a b class Requests_Transport_cURL implements Requests_Transport { 
    524524         * @return boolean True if the transport is valid, false otherwise.
    525525         */
    526526        public static function test($capabilities = array()) {
    527                 if (!function_exists('curl_init') && !function_exists('curl_exec')) {
     527                if (!function_exists('curl_init') || !function_exists('curl_exec')) {
    528528                        return false;
    529529                }
    530530
    class Requests_Transport_cURL implements Requests_Transport { 
    536536                        }
    537537                }
    538538
    539                 return true;
     539                /**
     540                 * Filters whether cURL can be used as a transport for retrieving a URL.
     541                 *
     542                 * @since 4.6.1
     543                 *
     544                 * @param bool  $use_class Whether the class can be used. Default true.
     545                 * @param array $capabilities An array of request arguments.
     546                 */
     547                return apply_filters( 'use_curl_transport', true, $capabilities );
    540548        }
    541549}