--- a/wp/wp-includes/http.php Fri Sep 05 18:40:08 2025 +0200
+++ b/wp/wp-includes/http.php Fri Sep 05 18:52:52 2025 +0200
@@ -45,6 +45,7 @@
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
*/
function wp_safe_remote_request( $url, $args = array() ) {
$args['reject_unsafe_urls'] = true;
@@ -71,6 +72,7 @@
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
*/
function wp_safe_remote_get( $url, $args = array() ) {
$args['reject_unsafe_urls'] = true;
@@ -97,6 +99,7 @@
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
*/
function wp_safe_remote_post( $url, $args = array() ) {
$args['reject_unsafe_urls'] = true;
@@ -123,6 +126,7 @@
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
*/
function wp_safe_remote_head( $url, $args = array() ) {
$args['reject_unsafe_urls'] = true;
@@ -146,20 +150,8 @@
* @param string $url URL to retrieve.
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
- * @return array|WP_Error {
- * The response array or a WP_Error on failure.
- *
- * @type string[] $headers Array of response headers keyed by their name.
- * @type string $body Response body.
- * @type array $response {
- * Data about the HTTP response.
- *
- * @type int|false $code HTTP response code.
- * @type string|false $message HTTP response message.
- * }
- * @type WP_HTTP_Cookie[] $cookies Array of response cookies.
- * @type WP_HTTP_Requests_Response|null $http_response Raw HTTP response object.
- * }
+ * @return array|WP_Error The response array or a WP_Error on failure.
+ * See WP_Http::request() for information on return value.
*/
function wp_remote_request( $url, $args = array() ) {
$http = _wp_http_get_object();
@@ -178,6 +170,7 @@
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
*/
function wp_remote_get( $url, $args = array() ) {
$http = _wp_http_get_object();
@@ -196,6 +189,7 @@
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
*/
function wp_remote_post( $url, $args = array() ) {
$http = _wp_http_get_object();
@@ -214,6 +208,7 @@
* @param array $args Optional. Request arguments. Default empty array.
* See WP_Http::request() for information on accepted arguments.
* @return array|WP_Error The response or WP_Error on failure.
+ * See WP_Http::request() for information on return value.
*/
function wp_remote_head( $url, $args = array() ) {
$http = _wp_http_get_object();
@@ -389,8 +384,6 @@
* @return bool
*/
function wp_http_supports( $capabilities = array(), $url = null ) {
- $http = _wp_http_get_object();
-
$capabilities = wp_parse_args( $capabilities );
$count = count( $capabilities );
@@ -407,7 +400,7 @@
}
}
- return (bool) $http->_get_first_available_transport( $capabilities );
+ return WpOrg\Requests\Requests::has_capabilities( $capabilities );
}
/**
@@ -542,7 +535,7 @@
* - ftp://example.com/caniload.php - Invalid protocol - only http and https are allowed.
* - http:///example.com/caniload.php - Malformed URL.
* - http://user:pass@example.com/caniload.php - Login information.
- * - http://exampleeeee.com/caniload.php - Invalid hostname, as the IP cannot be looked up in DNS.
+ * - http://example.invalid/caniload.php - Invalid hostname, as the IP cannot be looked up in DNS.
*
* Examples of URLs that are considered unsafe by default:
*
@@ -699,12 +692,8 @@
* A wrapper for PHP's parse_url() function that handles consistency in the return values
* across PHP versions.
*
- * PHP 5.4.7 expanded parse_url()'s ability to handle non-absolute URLs, including
- * schemeless and relative URLs with "://" in the path. This function works around
- * those limitations providing a standard output on PHP 5.2~5.4+.
- *
- * Secondly, across various PHP versions, schemeless URLs containing a ":" in the query
- * are being handled inconsistently. This function works around those differences as well.
+ * Across various PHP versions, schemeless URLs containing a ":" in the query
+ * are being handled inconsistently. This function works around those differences.
*
* @since 4.4.0
* @since 4.7.0 The `$component` parameter was added for parity with PHP's `parse_url()`.