From: Chad Horohoe Date: Fri, 8 Aug 2008 13:48:16 +0000 (+0000) Subject: (bug 14868) Setting $wgFeedDiffCutoff to 0 now stops generation of the diff entirely... X-Git-Tag: 1.31.0-rc.0~46015 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=1a0017a76f9c045002f1bf8496e8347a3dab6012;p=lhc%2Fweb%2Fwiklou.git (bug 14868) Setting $wgFeedDiffCutoff to 0 now stops generation of the diff entirely, not just display of it. No point in wasting time doing the former if you don't want the latter :) --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3160df2c5e..5ac8a1e815 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index aa784c026d..38bff363f5 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -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 .