From 763129619c31d12f9178704545596a4781ba85bd Mon Sep 17 00:00:00 2001 From: WMDE-Fisch Date: Wed, 22 Aug 2018 15:29:17 +0200 Subject: [PATCH] Prepare DiffRenderer to changed parameters for wikidiff2 1.8.0 The config parameter handling in wikidiff2 will migrate completely to phpini values. Due to that we will remove the php config variable wgWikiDiff2MovedParagraphDetectionCutoff and its usage. In the process of deleting the 4th parameter in the wikidiff2_do_diff() method, this exception is added so deployment can be handled separately. On the long run these exceptions will be removed completely and the (then) current mediawiki will depend on wikdiff2 > 1.8.0 Bug: T194272 Depends-On: I673d2489d5bce1a24a6ea83e168704948564661b Change-Id: I30262412b0784b84af88ffab6ed0694a08b671e9 --- includes/diff/TextSlotDiffRenderer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/diff/TextSlotDiffRenderer.php b/includes/diff/TextSlotDiffRenderer.php index baedcf05ee..9c60705587 100644 --- a/includes/diff/TextSlotDiffRenderer.php +++ b/includes/diff/TextSlotDiffRenderer.php @@ -209,7 +209,8 @@ class TextSlotDiffRenderer extends SlotDiffRenderer { $wikidiff2Version = phpversion( 'wikidiff2' ); if ( $wikidiff2Version !== false && - version_compare( $wikidiff2Version, '1.5.0', '>=' ) + version_compare( $wikidiff2Version, '1.5.0', '>=' ) && + version_compare( $wikidiff2Version, '1.8.0', '<' ) ) { $text = wikidiff2_do_diff( $oldText, @@ -218,7 +219,7 @@ class TextSlotDiffRenderer extends SlotDiffRenderer { $this->wikiDiff2MovedParagraphDetectionCutoff ); } else { - // Don't pass the 4th parameter for compatibility with older versions of wikidiff2 + // Don't pass the 4th parameter introduced in version 1.5.0 and removed in version 1.8.0 $text = wikidiff2_do_diff( $oldText, $newText, -- 2.20.1