From 63fca924cc119a7dca5272c3a37570f88c80b39d Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Thu, 26 Mar 2009 13:29:38 +0000 Subject: [PATCH] Fast short-circuit for diffs between identical strings --- includes/GlobalFunctions.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 0807f0be52..9afb3ad2b7 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1393,6 +1393,10 @@ function wfMerge( $old, $mine, $yours, &$result ){ * @return string Unified diff of $before and $after */ function wfDiff( $before, $after, $params = '-u' ) { + if ($before == $after) { + return ''; + } + global $wgDiff; # This check may also protect against code injection in -- 2.20.1