close

Make WordPress Core

Changeset 61769


Ignore:
Timestamp:
02/27/2026 11:35:34 PM (2 weeks ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update the Requests library to version 2.0.17.

The most notable changes are PHP 8.5 compatibility fixes in version 2.0.16. Other releases between 2.0.11 and 2.0.17 contain only certificate bundle updates, which are skipped as WordPress manages its own certificate bundle (#62812).

References:

Follow-up to [54997], [55629], [56554], [56835], [57086], [57876].

Props rodrigosprimo, desrosj.
Fixes #64752.

Location:
trunk/src/wp-includes/Requests/src
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/Requests/src/IdnaEncoder.php

    r55629 r61769  
    217217
    218218            if (// Non-shortest form sequences are invalid
    219                 $length > 1 && $character <= 0x7F
    220                 || $length > 2 && $character <= 0x7FF
    221                 || $length > 3 && $character <= 0xFFFF
     219                ($length > 1 && $character <= 0x7F)
     220                || ($length > 2 && $character <= 0x7FF)
     221                || ($length > 3 && $character <= 0xFFFF)
    222222                // Outside of range of ucschar codepoints
    223223                // Noncharacters
    224224                || ($character & 0xFFFE) === 0xFFFE
    225                 || $character >= 0xFDD0 && $character <= 0xFDEF
     225                || ($character >= 0xFDD0 && $character <= 0xFDEF)
    226226                || (
    227227                    // Everything else not in ucschar
    228                     $character > 0xD7FF && $character < 0xF900
     228                    ($character > 0xD7FF && $character < 0xF900)
    229229                    || $character < 0x20
    230                     || $character > 0x7E && $character < 0xA0
     230                    || ($character > 0x7E && $character < 0xA0)
    231231                    || $character > 0xEFFFD
    232232                )
  • trunk/src/wp-includes/Requests/src/Ipv6.php

    r54997 r61769  
    162162        $ipv6              = explode(':', $ipv6);
    163163        $ipv4              = explode('.', $ipv4);
    164         if (count($ipv6) === 8 && count($ipv4) === 1 || count($ipv6) === 6 && count($ipv4) === 4) {
     164        if ((count($ipv6) === 8 && count($ipv4) === 1) || (count($ipv6) === 6 && count($ipv4) === 4)) {
    165165            foreach ($ipv6 as $ipv6_part) {
    166166                // The section can't be empty
  • trunk/src/wp-includes/Requests/src/Iri.php

    r56835 r61769  
    215215        }
    216216
    217         if ($return === null && isset($this->normalization[$this->scheme][$name])) {
     217        if ($return === null && isset($this->scheme, $this->normalization[$this->scheme][$name])) {
    218218            return $this->normalization[$this->scheme][$name];
    219219        }
     
    670670
    671671    protected function scheme_normalization() {
    672         if (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo']) {
    673             $this->iuserinfo = null;
    674         }
    675         if (isset($this->normalization[$this->scheme]['ihost']) && $this->ihost === $this->normalization[$this->scheme]['ihost']) {
    676             $this->ihost = null;
    677         }
    678         if (isset($this->normalization[$this->scheme]['port']) && $this->port === $this->normalization[$this->scheme]['port']) {
    679             $this->port = null;
    680         }
    681         if (isset($this->normalization[$this->scheme]['ipath']) && $this->ipath === $this->normalization[$this->scheme]['ipath']) {
    682             $this->ipath = '';
     672        if (isset($this->scheme, $this->normalization[$this->scheme])) {
     673            if (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo']) {
     674                $this->iuserinfo = null;
     675            }
     676            if (isset($this->normalization[$this->scheme]['ihost']) && $this->ihost === $this->normalization[$this->scheme]['ihost']) {
     677                $this->ihost = null;
     678            }
     679            if (isset($this->normalization[$this->scheme]['port']) && $this->port === $this->normalization[$this->scheme]['port']) {
     680                $this->port = null;
     681            }
     682            if (isset($this->normalization[$this->scheme]['ipath']) && $this->ipath === $this->normalization[$this->scheme]['ipath']) {
     683                $this->ipath = '';
     684            }
     685            if (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery']) {
     686                $this->iquery = null;
     687            }
     688            if (isset($this->normalization[$this->scheme]['ifragment']) && $this->ifragment === $this->normalization[$this->scheme]['ifragment']) {
     689                $this->ifragment = null;
     690            }
    683691        }
    684692        if (isset($this->ihost) && empty($this->ipath)) {
    685693            $this->ipath = '/';
    686         }
    687         if (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery']) {
    688             $this->iquery = null;
    689         }
    690         if (isset($this->normalization[$this->scheme]['ifragment']) && $this->ifragment === $this->normalization[$this->scheme]['ifragment']) {
    691             $this->ifragment = null;
    692694        }
    693695    }
  • trunk/src/wp-includes/Requests/src/Requests.php

    r57876 r61769  
    149149     * @var string
    150150     */
    151     const VERSION = '2.0.11';
     151    const VERSION = '2.0.17';
    152152
    153153    /**
  • trunk/src/wp-includes/Requests/src/Response/Headers.php

    r55629 r61769  
    3636        }
    3737
    38         if (!isset($this->data[$offset])) {
     38        if (!isset($offset, $this->data[$offset])) {
    3939            return null;
    4040        }
  • trunk/src/wp-includes/Requests/src/Transport/Curl.php

    r57086 r61769  
    127127    public function __destruct() {
    128128        if (is_resource($this->handle)) {
     129            // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.curl_closeDeprecated,Generic.PHP.DeprecatedFunctions.Deprecated
    129130            curl_close($this->handle);
    130131        }
     
    307308
    308309                curl_multi_remove_handle($multihandle, $done['handle']);
    309                 curl_close($done['handle']);
     310                if (is_resource($done['handle'])) {
     311                    // phpcs:ignore PHPCompatibility.FunctionUse.RemovedFunctions.curl_closeDeprecated,Generic.PHP.DeprecatedFunctions.Deprecated
     312                    curl_close($done['handle']);
     313                }
    310314
    311315                if (!is_string($responses[$key])) {
  • trunk/src/wp-includes/Requests/src/Transport/Fsockopen.php

    r57876 r61769  
    149149            if (function_exists('stream_context_set_options')) {
    150150                // PHP 8.3+.
     151                // phpcs:ignore PHPCompatibility.FunctionUse.NewFunctions.stream_context_set_optionsFound
    151152                stream_context_set_options($context, ['ssl' => $context_options]);
    152153            } else {
    153154                // PHP < 8.3.
     155                // phpcs:ignore PHPCompatibility.FunctionUse.OptionalToRequiredFunctionParameters
    154156                stream_context_set_option($context, ['ssl' => $context_options]);
    155157            }
  • trunk/src/wp-includes/Requests/src/Utility/CaseInsensitiveDictionary.php

    r55629 r61769  
    5050        }
    5151
     52        if ($offset === null) {
     53            $offset = '';
     54        }
     55
    5256        return isset($this->data[$offset]);
    5357    }
     
    6367        if (is_string($offset)) {
    6468            $offset = strtolower($offset);
     69        }
     70
     71        if ($offset === null) {
     72            $offset = '';
    6573        }
    6674
     
    104112        }
    105113
     114        if ($offset === null) {
     115            $offset = '';
     116        }
     117
    106118        unset($this->data[$offset]);
    107119    }
  • trunk/src/wp-includes/Requests/src/Utility/FilteredIterator.php

    r55629 r61769  
    2929     * Create a new iterator
    3030     *
    31      * @param array    $data     The array or object to be iterated on.
     31     * @param array    $data     The array to be iterated on.
    3232     * @param callable $callback Callback to be called on each value
    3333     *
     
    3535     */
    3636    public function __construct($data, $callback) {
    37         if (InputValidator::is_iterable($data) === false) {
     37        if (is_object($data) === true || InputValidator::is_iterable($data) === false) {
    3838            throw InvalidArgument::create(1, '$data', 'iterable', gettype($data));
    3939        }
Note: See TracChangeset for help on using the changeset viewer.