Make WordPress Core


Ignore:
Timestamp:
10/26/2017 12:51:51 PM (7 years ago)
Author:
johnbillion
Message:

External Libraries: Remove usage of each() from the Text_Diff_Engine_native class.

This removes deprecated notices in PHP 7.2 but takes a different approach to the upstream class from Horde, which appears to be buggy.

Props SergeyBiryukov
Fixes #41526

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/Text/Diff/Engine/native.php

    r42027 r42028  
    191191                $matches = $ymatches[$line];
    192192                reset($matches);
    193                 while (list(, $y) = each($matches)) {
     193                while ($y = current($matches)) {
    194194                    if (empty($this->in_seq[$y])) {
    195195                        $k = $this->_lcsPos($y);
     
    198198                        break;
    199199                    }
    200                 }
    201                 while (list(, $y) = each($matches)) {
     200                    next($matches);
     201                }
     202                while ($y = current($matches)) {
    202203                    if ($y > $this->seq[$k - 1]) {
    203204                        assert($y <= $this->seq[$k]);
     
    212213                        $ymids[$k] = $ymids[$k - 1];
    213214                    }
     215                    next($matches);
    214216                }
    215217            }
Note: See TracChangeset for help on using the changeset viewer.