X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fdiff%2FDiffEngine.php;h=142c51d7a0c5c87e149998e08f1254b5a9240f2e;hb=2e1b3f94ad3620c87d8f5587576628a56556054e;hp=53378e5827fd59aa832396279013f2e72fe93367;hpb=2c12b1fd2afc14a03c16f05c844320985d911ca0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/diff/DiffEngine.php b/includes/diff/DiffEngine.php index 53378e5827..142c51d7a0 100644 --- a/includes/diff/DiffEngine.php +++ b/includes/diff/DiffEngine.php @@ -24,6 +24,9 @@ */ use MediaWiki\Diff\ComplexityException; +// FIXME: Don't use assert() in this file +// phpcs:disable MediaWiki.Usage.ForbiddenFunctions.assert + /** * This diff implementation is mainly lifted from the LCS algorithm of the Eclipse project which * in turn is based on Myers' "An O(ND) difference algorithm and its variations" @@ -348,7 +351,7 @@ class DiffEngine { $this->maxDifferences = ceil( ( $this->m + $this->n ) / 2.0 ); if ( $this->m * $this->n > $this->tooLong ) { // limit complexity to D^POW_LIMIT for long sequences - $this->maxDifferences = floor( pow( $this->maxDifferences, $this->powLimit - 1.0 ) ); + $this->maxDifferences = floor( $this->maxDifferences ** ( $this->powLimit - 1.0 ) ); wfDebug( "Limiting max number of differences to $this->maxDifferences\n" ); }