From: Jens Rehsack Date: Tue, 7 Aug 2012 14:42:24 +0000 (+0200) Subject: fix issue with non-existing opts X-Git-Tag: v0.100~14 X-Git-Url: https://repo.or.cz/w/WWW-Mechanize-Script.git/commitdiff_plain/c8940f50b8b141e3c7eb7188eae125e4ca3e422d fix issue with non-existing opts --- 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;