Make WordPress Core

Ticket #40109: 40109-string-asserts.patch

File 40109-string-asserts.patch, 2.8 KB (added by desrosj, 8 years ago)

Fixes all assert() calls with strings passed.

  • src/wp-includes/Text/Diff/Engine/native.php

     
    330330        $i = 0;
    331331        $j = 0;
    332332
    333         assert('count($lines) == count($changed)');
     333        assert( count($lines) == count($changed) );
    334334        $len = count($lines);
    335335        $other_len = count($other_changed);
    336336
     
    351351            }
    352352
    353353            while ($i < $len && ! $changed[$i]) {
    354                 assert('$j < $other_len && ! $other_changed[$j]');
     354                assert( $j < $other_len && ! $other_changed[$j] );
    355355                $i++; $j++;
    356356                while ($j < $other_len && $other_changed[$j]) {
    357357                    $j++;
     
    383383                    while ($start > 0 && $changed[$start - 1]) {
    384384                        $start--;
    385385                    }
    386                     assert('$j > 0');
     386                    assert( $j > 0 );
    387387                    while ($other_changed[--$j]) {
    388388                        continue;
    389389                    }
    390                     assert('$j >= 0 && !$other_changed[$j]');
     390                    assert( $j >= 0 && !$other_changed[$j] );
    391391                }
    392392
    393393                /* Set CORRESPONDING to the end of the changed run, at the
     
    408408                        $i++;
    409409                    }
    410410
    411                     assert('$j < $other_len && ! $other_changed[$j]');
     411                    assert( $j < $other_len && ! $other_changed[$j] );
    412412                    $j++;
    413413                    if ($j < $other_len && $other_changed[$j]) {
    414414                        $corresponding = $i;
     
    424424            while ($corresponding < $i) {
    425425                $changed[--$start] = 1;
    426426                $changed[--$i] = 0;
    427                 assert('$j > 0');
     427                assert( $j > 0 );
    428428                while ($other_changed[--$j]) {
    429429                    continue;
    430430                }
    431                 assert('$j >= 0 && !$other_changed[$j]');
     431                assert( $j >= 0 && !$other_changed[$j] );
    432432            }
    433433        }
    434434    }
  • src/wp-includes/Text/Diff/Engine/shell.php

     
    8383
    8484            if ($from_line_no < $match[1] || $to_line_no < $match[4]) {
    8585                // copied lines
    86                 assert('$match[1] - $from_line_no == $match[4] - $to_line_no');
     86                assert( $match[1] - $from_line_no == $match[4] - $to_line_no );
    8787                array_push($edits,
    8888                    new Text_Diff_Op_copy(
    8989                        $this->_getLines($from_lines, $from_line_no, $match[1] - 1),