(bug 14868) Setting $wgFeedDiffCutoff to 0 now stops generation of the diff entirely...
authorChad Horohoe <demon@users.mediawiki.org>
Fri, 8 Aug 2008 13:48:16 +0000 (13:48 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Fri, 8 Aug 2008 13:48:16 +0000 (13:48 +0000)
RELEASE-NOTES
includes/FeedUtils.php

index 3160df2..5ac8a1e 100644 (file)
@@ -82,6 +82,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 12370) Add throttle on password attempts. Defaults to max 5 attempts in 5 minutes.
 * (bug 15016) 'Templates used on this page' list in view source should be wrapped 
   in a div with class "templatesUsed"
+* (bug 14868) Setting $wgFeedDiffCutoff to 0 now disables generation of the diff
+  entirely, not just the display of it.
 
 === API changes in 1.14 ===
 
index aa784c0..38bff36 100644 (file)
@@ -75,17 +75,20 @@ class FeedUtils {
                        if( $oldid ) {
                                wfProfileIn( __FUNCTION__."-dodiff" );
 
-                               $de = new DifferenceEngine( $title, $oldid, $newid );
                                #$diffText = $de->getDiff( wfMsg( 'revisionasof',
                                #       $wgContLang->timeanddate( $timestamp ) ),
                                #       wfMsg( 'currentrev' ) );
-                               $diffText = $de->getDiff(
-                                       wfMsg( 'previousrevision' ), // hack
-                                       wfMsg( 'revisionasof',
-                                               $wgContLang->timeanddate( $timestamp ) ) );
-
+                               
+                               // Don't bother generating the diff if we won't be able to show it
+                               if ( $wgFeedDiffCutoff > 0 ) {
+                                       $de = new DifferenceEngine( $title, $oldid, $newid );
+                                       $diffText = $de->getDiff(
+                                               wfMsg( 'previousrevision' ), // hack
+                                               wfMsg( 'revisionasof',
+                                                       $wgContLang->timeanddate( $timestamp ) ) );
+                               }
 
-                               if ( strlen( $diffText ) > $wgFeedDiffCutoff ) {
+                               if ( ( strlen( $diffText ) > $wgFeedDiffCutoff ) || ( $wgFeedDiffCutoff <= 0 ) ) {
                                        // Omit large diffs
                                        $diffLink = $title->escapeFullUrl(
                                                'diff=' . $newid .