From c8940f50b8b141e3c7eb7188eae125e4ca3e422d Mon Sep 17 00:00:00 2001 From: Jens Rehsack Date: Tue, 7 Aug 2012 16:42:24 +0200 Subject: [PATCH] fix issue with non-existing opts --- lib/WWW/Mechanize/Script/Plugin/TextMatchTest.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/WWW/Mechanize/Script/Plugin/TextMatchTest.pm b/lib/WWW/Mechanize/Script/Plugin/TextMatchTest.pm index 370d5c7..33e1b9f 100644 --- a/lib/WWW/Mechanize/Script/Plugin/TextMatchTest.pm +++ b/lib/WWW/Mechanize/Script/Plugin/TextMatchTest.pm @@ -25,8 +25,8 @@ sub check_response my $ignore_case = $self->get_check_value_as_bool( $check, "ignore_case" ); my $content = $mech->is_html() ? $mech->text() : $mech->content(); - _ARRAY0($text_require) or $text_require = [$text_require]; - _ARRAY0($text_forbid) or $text_forbid = [$text_forbid]; + defined($text_require) and ref($text_require) ne "ARRAY" and $text_require = [$text_require]; + defined($text_forbid) and ref($text_forbid) ne "ARRAY" and $text_forbid = [$text_forbid]; my @match_fails; my $code = 0; -- 2.11.4.GIT