summaryrefslogtreecommitdiffstats
path: root/extensions/InlineHistory/Extension.pm
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/InlineHistory/Extension.pm')
-rw-r--r--extensions/InlineHistory/Extension.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/extensions/InlineHistory/Extension.pm b/extensions/InlineHistory/Extension.pm
index f761a9fbd..df7ae9f62 100644
--- a/extensions/InlineHistory/Extension.pm
+++ b/extensions/InlineHistory/Extension.pm
@@ -18,6 +18,19 @@ our $VERSION = '1.5';
# don't show inline history for bugs with lots of changes
use constant MAXIMUM_ACTIVITY_COUNT => 500;
+# don't show really long values
+use constant MAXIMUM_VALUE_LENGTH => 256;
+
+sub template_before_create {
+ my ($self, $args) = @_;
+ $args->{config}->{FILTERS}->{ih_short_value} = sub {
+ my ($str) = @_;
+ return length($str) <= MAXIMUM_VALUE_LENGTH
+ ? $str
+ : substr($str, 0, MAXIMUM_VALUE_LENGTH - 3) . '...';
+ };
+}
+
sub template_before_process {
my ($self, $args) = @_;
my $file = $args->{'file'};