From 6d85f93feb0b0df35c94e0a75819e207638dc014 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 13 May 2013 10:09:46 +0100 Subject: [PATCH] Support option list arrays (as used in Template) in validation. --- Webperl/Block.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Webperl/Block.pm b/Webperl/Block.pm index 0b9119f..ebd6cb6 100644 --- a/Webperl/Block.pm +++ b/Webperl/Block.pm @@ -246,7 +246,11 @@ sub validate_options { # Determine how we will check it. If the source is an array reference, we do an array check if(ref($settings -> {"source"}) eq "ARRAY") { foreach my $check (@{$settings -> {"source"}}) { - return ($value, undef) if($check eq $value); + if(ref($check) eq "HASH") { + return ($value, undef) if($check -> {"value"} eq $value); + } else { + return ($value, undef) if($check eq $value); + } } # If the source is not a reference, we assue it is the table name to check