X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/4fb26f4e60f2df282fc972e4b8506ccd306de789..ef94fa192adedd47978b4c7f8f317d343ca46913:/IkiWiki/Plugin/recentchangesdiff.pm?ds=inline diff --git a/IkiWiki/Plugin/recentchangesdiff.pm b/IkiWiki/Plugin/recentchangesdiff.pm index 71297572d..418822793 100644 --- a/IkiWiki/Plugin/recentchangesdiff.pm +++ b/IkiWiki/Plugin/recentchangesdiff.pm @@ -31,13 +31,21 @@ sub pagetemplate (@) { my @lines=IkiWiki::rcs_diff($params{rev}, $maxlines+1); if (@lines) { my $diff; + my $trunc=0; if (@lines > $maxlines) { - $diff=join("", @lines[0..($maxlines-1)])."\n". - gettext("(Diff truncated)"); + $diff=join("", @lines[0..($maxlines-1)]); + $trunc=1; } else { $diff=join("", @lines); } + if (length $diff > 102400) { + $diff=substr($diff, 0, 10240); + $trunc=1; + } + if ($trunc) { + $diff.="\n".gettext("(Diff truncated)"); + } # escape html $diff = encode_entities($diff); # escape links and preprocessor stuff