Prepare DiffRenderer to changed parameters for wikidiff2 1.8.0
authorWMDE-Fisch <christoph.jauera@wikimedia.de>
Wed, 22 Aug 2018 13:29:17 +0000 (15:29 +0200)
committerWMDE-Fisch <christoph.jauera@wikimedia.de>
Thu, 23 Aug 2018 15:37:29 +0000 (15:37 +0000)
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

index baedcf0..9c60705 100644 (file)
@@ -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,