Make WordPress Core

Ticket #63576: wp-request.patch

File wp-request.patch, 707 bytes (added by granthony, 6 months ago)

Patch for WP::Requests class to handle '0' response body

  • wp-includes/Requests/src/Requests.php

    commit 28906726c274bf4a05f064fe81a574cf1b661c37
    Author: graeme <graeme.anthony@digitalsix.co.uk>
    Date:   Thu May 29 13:38:07 2025 +0100
    
        Patch WP::Requests class and handle '0' response
    
    diff --git a/wp-includes/Requests/src/Requests.php b/wp-includes/Requests/src/Requests.php
    index 5c6f13e05..9f81fda26 100644
    a b class Requests { 
    740740                        $headers = substr($return->raw, 0, $pos);
    741741                        // Headers will always be separated from the body by two new lines - `\n\r\n\r`.
    742742                        $body = substr($return->raw, $pos + 4);
    743                         if (!empty($body)) {
     743                        if (!is_null($body)) {
    744744                                $return->body = $body;
    745745                        }
    746746                }