Make WordPress Core

Changeset 60787


Ignore:
Timestamp:
09/20/2025 10:11:36 PM (8 weeks ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Update sodium_compat to v1.21.2.

Version 1.21.2 is mostly to prevent deprecation warnings on PHP 8.5. These should never be encountered in practice (as the only file in scope was an SplFixedArray polyfill for PHP 5.2, which should never be executed on PHP 8.5), but for completeness the polyfill was updated.

References:

Follow-up to [55699], [58752], [58753].

Props paragoninitiativeenterprises, jrf, johnbillion, TobiasBg, SergeyBiryukov.
Fixes #64008.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/sodium_compat/src/PHP52/SplFixedArray.php

    r49741 r60787  
    3333     * @return int
    3434     */
     35    #[\ReturnTypeWillChange]
    3536    public function count()
    3637    {
     
    7374     * @return int
    7475     */
     76    #[\ReturnTypeWillChange]
    7577    public function getSize()
    7678    {
     
    8284     * @return bool
    8385     */
     86    #[\ReturnTypeWillChange]
    8487    public function setSize($size)
    8588    {
     
    9295     * @return bool
    9396     */
     97    #[\ReturnTypeWillChange]
    9498    public function offsetExists($index)
    9599    {
     
    101105     * @return mixed
    102106     */
     107    #[\ReturnTypeWillChange]
    103108    public function offsetGet($index)
    104109    {
     
    112117     * @psalm-suppress MixedAssignment
    113118     */
     119    #[\ReturnTypeWillChange]
    114120    public function offsetSet($index, $newval)
    115121    {
     
    120126     * @param string|int $index
    121127     */
     128    #[\ReturnTypeWillChange]
    122129    public function offsetUnset($index)
    123130    {
     
    131138     * @since 5.3.0
    132139     */
     140    #[\ReturnTypeWillChange]
    133141    public function rewind()
    134142    {
     
    142150     * @since 5.3.0
    143151     */
     152    #[\ReturnTypeWillChange]
    144153    public function current()
    145154    {
     
    152161     * @return int The current array index.
    153162     */
     163    #[\ReturnTypeWillChange]
    154164    public function key()
    155165    {
     
    160170     * @return void
    161171     */
     172    #[\ReturnTypeWillChange]
    162173    public function next()
    163174    {
     
    170181     * @return bool true if the array contains any more elements, false otherwise.
    171182     */
     183    #[\ReturnTypeWillChange]
    172184    public function valid()
    173185    {
     
    180192    }
    181193
     194    public function __sleep()
     195    {
     196        return $this->internalArray;
     197    }
     198
    182199    /**
    183200     * Do nothing.
     
    187204        // NOP
    188205    }
     206
     207    public function __serialize()
     208    {
     209        return array_values($this->internalArray);
     210    }
     211
     212    public function __unserialize(array $data)
     213    {
     214        $length = count($data);
     215        $values = array_values($data);
     216        for ($i = 0; $i < $length; ++$i) {
     217            $this->internalArray[$i] = $values[$i];
     218        }
     219        $this->size = $length;
     220    }
    189221}
Note: See TracChangeset for help on using the changeset viewer.