[interchange-cvs] interchange - heins modified lib/Vend/Interpolate.pm
interchange-core@icdevgroup.org
interchange-core@icdevgroup.org
Fri Oct 18 03:09:01 2002
User: heins
Date: 2002-10-18 07:08:42 GMT
Modified: lib/Vend Interpolate.pm
Log:
* Allow limiting size of text input to a loop list when
Limit list_text_size 5000
If reduced to a smaller amount, can help find runaway lists.
Revision Changes Path
2.118 +11 -2 interchange/lib/Vend/Interpolate.pm
rev 2.118, prev_rev 2.117
Index: Interpolate.pm
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /var/cvs/interchange/lib/Vend/Interpolate.pm,v
retrieving revision 2.117
retrieving revision 2.118
diff -u -r2.117 -r2.118
--- Interpolate.pm 11 Oct 2002 18:33:17 -0000 2.117
+++ Interpolate.pm 18 Oct 2002 07:08:42 -0000 2.118
@@ -1,6 +1,6 @@
# Vend::Interpolate - Interpret Interchange tags
#=20
-# $Id: Interpolate.pm,v 2.117 2002/10/11 18:33:17 mheins Exp $
+# $Id: Interpolate.pm,v 2.118 2002/10/18 07:08:42 mheins Exp $
#
# Copyright (C) 1996-2002 Red Hat, Inc. <interchange@redhat.com>
#
@@ -27,7 +27,7 @@
require Exporter;
@ISA =3D qw(Exporter);
=20
-$VERSION =3D substr(q$Revision: 2.117 $, 10);
+$VERSION =3D substr(q$Revision: 2.118 $, 10);
=20
@EXPORT =3D qw (
=20
@@ -4410,6 +4410,15 @@
=20
my $r =3D '';
$opt ||=3D {};
+
+ my $lim;
+ if($lim =3D $Vend::Cfg->{Limit}{list_text_size} and length($text) > $lim)=
{
+ my $len =3D length($text);
+ my $caller =3D join "|", caller();
+ my $msg =3D "Large list text encountered, length=3D$len, caller=3D$call=
er";
+ logError($msg);
+ return undef if $Vend::Cfg->{Limit}{list_text_overflow} eq 'abort';
+ }
=20
# Optimize for no-match, on-match, etc
if(! $opt->{iterator} and $text !~ /\[(?:if-)?$Prefix-/) {