From dd57ff3cce86f3055c249a414c49b74f2bcb3497 Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Tue, 26 Apr 2016 18:10:26 -0700 Subject: Rethink diff limits Now, instead of "if your changed paragraphs are larger than 10Kb, you're screwed": * Instead of relying on overall length, estimate complexity after splitting to words and taking any equal head and tail out of equation. * Estimate based on words changed, which better reflects the actual complexity of generating a diff. * New limit is determined scientifically, i.e. "above that number XDebug starts complaining about recursion limits reached in Vagrant". Caveat: if new limits are hit, the consequences are more widespread as all adjacent changed paragraphs are displayed without word level diffs, as opposed to only the paragraph that's too long being affected. However, the new limit is much higher and in wikitext you're supposed to put empty lines between paragraphs anyway, negating this problem. Bug: T128697 Change-Id: I4e91c7c40f5afdd116b847a859b8517522302489 --- includes/diff/ComplexityException.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 includes/diff/ComplexityException.php (limited to 'includes/diff/ComplexityException.php') diff --git a/includes/diff/ComplexityException.php b/includes/diff/ComplexityException.php new file mode 100644 index 000000000000..10ca964ac236 --- /dev/null +++ b/includes/diff/ComplexityException.php @@ -0,0 +1,30 @@ +