Merge "Convert Special:DeletedContributions to use OOUI."
[lhc/web/wiklou.git] / includes / diff / DairikiDiff.php
index dbb32e6..d38319e 100644 (file)
@@ -204,6 +204,12 @@ class Diff {
         */
        public $edits;
 
+       /**
+        * @var int If this diff complexity is exceeded, a ComplexityException is thrown
+        *          0 means no limit.
+        */
+       protected $bailoutComplexity = 0;
+
        /**
         * Constructor.
         * Computes diff between sequences of strings.
@@ -211,9 +217,11 @@ class Diff {
         * @param string[] $from_lines An array of strings.
         *   Typically these are lines from a file.
         * @param string[] $to_lines An array of strings.
+        * @throws \MediaWiki\Diff\ComplexityException
         */
        public function __construct( $from_lines, $to_lines ) {
                $eng = new DiffEngine;
+               $eng->setBailoutComplexity( $this->bailoutComplexity );
                $this->edits = $eng->diff( $from_lines, $to_lines );
        }