diff options
Diffstat (limited to 'wp-includes/Requests/src/Transport/Fsockopen.php')
-rw-r--r-- | wp-includes/Requests/src/Transport/Fsockopen.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/wp-includes/Requests/src/Transport/Fsockopen.php b/wp-includes/Requests/src/Transport/Fsockopen.php index 2b53d0c..6bd82a3 100644 --- a/wp-includes/Requests/src/Transport/Fsockopen.php +++ b/wp-includes/Requests/src/Transport/Fsockopen.php @@ -144,7 +144,15 @@ final class Fsockopen implements Transport { $verifyname = false; } - stream_context_set_option($context, ['ssl' => $context_options]); + // Handle the PHP 8.4 deprecation (PHP 9.0 removal) of the function signature we use for stream_context_set_option(). + // Ref: https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#stream_context_set_option + if (function_exists('stream_context_set_options')) { + // PHP 8.3+. + stream_context_set_options($context, ['ssl' => $context_options]); + } else { + // PHP < 8.3. + stream_context_set_option($context, ['ssl' => $context_options]); + } } else { $remote_socket = 'tcp://' . $host; } |