Make WordPress Core

Changeset 49741


Ignore:
Timestamp:
12/03/2020 05:39:03 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Update sodium_compat to v1.14.0.

This includes improved PHP 8 support and more inclusive language.

A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.13.0...v1.14.0

Follow-up to [48121], [49056], [49057].

Props jrf.
Fixes #51925.

Location:
trunk/src/wp-includes/sodium_compat
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/sodium_compat/composer.json

    r46858 r49741  
    5555  },
    5656  "require-dev": {
    57     "phpunit/phpunit": "^3|^4|^5|^6|^7"
     57    "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9"
    5858  },
    5959  "suggest": {
  • trunk/src/wp-includes/sodium_compat/src/Core/SipHash.php

    r46586 r49741  
    1515     * @internal You should not use this directly from another application
    1616     *
    17      * @param int[] $v
    18      * @return int[]
     17     * @param array<array-key, int> $v
     18     * @return array<array-key, int>
     19     *
    1920     */
    2021    public static function sipRound(array $v)
     
    2728
    2829        #  v1=ROTL(v1,13);
    29         list($v[2], $v[3]) = self::rotl_64($v[2], $v[3], 13);
     30        list($v[2], $v[3]) = self::rotl_64((int) $v[2], (int) $v[3], 13);
    3031
    3132        #  v1 ^= v0;
    32         $v[2] ^= $v[0];
    33         $v[3] ^= $v[1];
     33        $v[2] = (int) $v[2] ^ (int) $v[0];
     34        $v[3] = (int) $v[3] ^ (int) $v[1];
    3435
    3536        #  v0=ROTL(v0,32);
     
    3839        # v2 += v3;
    3940        list($v[4], $v[5]) = self::add(
    40             array($v[4], $v[5]),
    41             array($v[6], $v[7])
     41            array((int) $v[4], (int) $v[5]),
     42            array((int) $v[6], (int) $v[7])
    4243        );
    4344
    4445        # v3=ROTL(v3,16);
    45         list($v[6], $v[7]) = self::rotl_64($v[6], $v[7], 16);
     46        list($v[6], $v[7]) = self::rotl_64((int) $v[6], (int) $v[7], 16);
    4647
    4748        #  v3 ^= v2;
    48         $v[6] ^= $v[4];
    49         $v[7] ^= $v[5];
     49        $v[6] = (int) $v[6] ^ (int) $v[4];
     50        $v[7] = (int) $v[7] ^ (int) $v[5];
    5051
    5152        # v0 += v3;
     
    5960
    6061        # v3 ^= v0;
    61         $v[6] ^= $v[0];
    62         $v[7] ^= $v[1];
     62        $v[6] = (int) $v[6] ^ (int) $v[0];
     63        $v[7] = (int) $v[7] ^ (int) $v[1];
    6364
    6465        # v2 += v1;
     
    7273
    7374        #  v1 ^= v2;;
    74         $v[2] ^= $v[4];
    75         $v[3] ^= $v[5];
     75        $v[2] = (int) $v[2] ^ (int) $v[4];
     76        $v[3] = (int) $v[3] ^ (int) $v[5];
    7677
    7778        # v2=ROTL(v2,32)
  • trunk/src/wp-includes/sodium_compat/src/Core/Util.php

    r49057 r49741  
    904904     * @internal You should not use this directly from another application
    905905     *
     906     * Note: MB_OVERLOAD_STRING === 2, but we don't reference the constant
     907     * (for nuisance-free PHP 8 support)
     908     *
    906909     * @return bool
    907910     */
     
    914917                && defined('MB_OVERLOAD_STRING')
    915918                &&
    916             ((int) (ini_get('mbstring.func_overload')) & MB_OVERLOAD_STRING);
     919            ((int) (ini_get('mbstring.func_overload')) & 2);
     920            // MB_OVERLOAD_STRING === 2
    917921        }
    918922        /** @var bool $mbstring */
  • trunk/src/wp-includes/sodium_compat/src/File.php

    r49056 r49741  
    244244            ParagonIE_Sodium_Compat::memzero($ephKeypair);
    245245        } catch (SodiumException $ex) {
     246            /** @psalm-suppress PossiblyUndefinedVariable */
    246247            unset($ephKeypair);
    247248        }
     
    542543            ParagonIE_Sodium_Compat::memzero($key);
    543544        } catch (SodiumException $ex) {
     545            /** @psalm-suppress PossiblyUndefinedVariable */
    544546            unset($key);
    545547        }
  • trunk/src/wp-includes/sodium_compat/src/PHP52/SplFixedArray.php

    r46858 r49741  
    103103    public function offsetGet($index)
    104104    {
     105        /** @psalm-suppress MixedReturnStatement */
    105106        return $this->internalArray[(int) $index];
    106107    }
     
    143144    public function current()
    144145    {
     146        /** @psalm-suppress MixedReturnStatement */
    145147        return current($this->internalArray);
    146148    }
Note: See TracChangeset for help on using the changeset viewer.