Log Message:
-----------
Patched Filter::Map to close rt18551
Added sanity check to modify()
Modified Paths:
--------------
trunk/poe/lib/POE/Filter/Map.pm
Modified: trunk/poe/lib/POE/Filter/Map.pm
===================================================================
--- trunk/poe/lib/POE/Filter/Map.pm 2006-04-29 22:58:20 UTC (rev 1947)
+++ trunk/poe/lib/POE/Filter/Map.pm 2006-04-30 06:35:56 UTC (rev 1948)
@@ -34,6 +34,11 @@
defined($params{Code}) or
(defined($params{Get}) and defined($params{Put}))
);
+ croak "Code element is not a subref"
+ unless (defined $params{Code} and ref $params{Code} eq 'CODE');
+ croak "Get or Put element is not a subref"
+ unless ((defined $params{Get} and ref $params{Get} eq 'CODE')
+ and (defined $params{Put} and ref $params{Put} eq 'CODE'));
my $self = bless [
[ ], # BUFFER
@@ -89,6 +94,7 @@
my ($self, %params) = @_;
for (keys %params) {
next unless ($_ eq 'Put') || ($_ eq 'Get') || ($_ eq 'Code');
+ croak "$_ element must be a subref" unless ref $params{$_} eq 'CODE';
$self->[
{
Put => CODEPUT,