Make WordPress Core


Ignore:
Timestamp:
05/11/2021 07:40:41 PM (4 years ago)
Author:
desrosj
Message:

External Libraries: Update the Requests library to version 1.8.0.

While some of the changes in the 1.8.0 release have already been copied to WordPress Core in earlier releases (see [38727], [46258], [47902] and [49382]), this release contains additional improvements, including:

  • A significant performance fix when using cURL.
  • Improved compliance with RFC2616.

The library has also been moved under the WordPress project’s GitHub organization and can now be found at https://github.com/WordPress/Requests.

Props jrf, dd32, rmccue, justinahinon, netweb, schlessera, TimothyBJacobs, soulseekah, ozh, skithund, carlalexander, travisnorthcutt, desrosj.
Fixes #53101.

File:
1 edited

Legend:

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

    r46586 r50842  
    4141
    4242        list($ip1, $ip2) = explode('::', $ip);
    43         $c1 = ($ip1 === '') ? -1 : substr_count($ip1, ':');
    44         $c2 = ($ip2 === '') ? -1 : substr_count($ip2, ':');
     43        $c1              = ($ip1 === '') ? -1 : substr_count($ip1, ':');
     44        $c2              = ($ip2 === '') ? -1 : substr_count($ip2, ':');
    4545
    4646        if (strpos($ip2, '.') !== false) {
     
    5252        }
    5353        // ::xxx
    54         else if ($c1 === -1) {
     54        elseif ($c1 === -1) {
    5555            $fill = str_repeat('0:', 7 - $c2);
    56             $ip = str_replace('::', $fill, $ip);
     56            $ip   = str_replace('::', $fill, $ip);
    5757        }
    5858        // xxx::
    59         else if ($c2 === -1) {
     59        elseif ($c2 === -1) {
    6060            $fill = str_repeat(':0', 7 - $c1);
    61             $ip = str_replace('::', $fill, $ip);
     61            $ip   = str_replace('::', $fill, $ip);
    6262        }
    6363        // xxx::xxx
    6464        else {
    6565            $fill = ':' . str_repeat('0:', 6 - $c2 - $c1);
    66             $ip = str_replace('::', $fill, $ip);
     66            $ip   = str_replace('::', $fill, $ip);
    6767        }
    6868        return $ip;
     
    8585    public static function compress($ip) {
    8686        // Prepare the IP to be compressed
    87         $ip = self::uncompress($ip);
     87        $ip       = self::uncompress($ip);
    8888        $ip_parts = self::split_v6_v4($ip);
    8989
     
    127127    protected static function split_v6_v4($ip) {
    128128        if (strpos($ip, '.') !== false) {
    129             $pos = strrpos($ip, ':');
     129            $pos       = strrpos($ip, ':');
    130130            $ipv6_part = substr($ip, 0, $pos);
    131131            $ipv4_part = substr($ip, $pos + 1);
     
    146146     */
    147147    public static function check_ipv6($ip) {
    148         $ip = self::uncompress($ip);
     148        $ip                = self::uncompress($ip);
    149149        list($ipv6, $ipv4) = self::split_v6_v4($ip);
    150         $ipv6 = explode(':', $ipv6);
    151         $ipv4 = explode('.', $ipv4);
     150        $ipv6              = explode(':', $ipv6);
     151        $ipv4              = explode('.', $ipv4);
    152152        if (count($ipv6) === 8 && count($ipv4) === 1 || count($ipv6) === 6 && count($ipv4) === 4) {
    153153            foreach ($ipv6 as $ipv6_part) {
Note: See TracChangeset for help on using the changeset viewer.