Commit 55910793 authored by Shawn M Moore's avatar Shawn M Moore
Browse files

Strengthen the object test from exists to blessed

    Otherwise, ->can throws an error
parent 7233d347
......@@ -74,6 +74,7 @@ no warnings qw(redefine);
use Text::Template;
use MIME::Entity;
use MIME::Parser;
use Scalar::Util 'blessed';
sub _Accessible {
my $self = shift;
......@@ -494,7 +495,7 @@ sub _ParseContentSimple {
# XXX: this should be locked down otherwise you could say
# $TicketObj->Steal or something similarly ugly
elsif (my ($obj, $method) = $fi_text =~ /^\$(\w+)->(\w+)$/) {
if (exists $args{TemplateArgs}{$obj} && $args{TemplateArgs}{$obj}->can($method)) {
if (blessed($args{TemplateArgs}{$obj}) && $args{TemplateArgs}{$obj}->can($method)) {
$fi_res = $args{TemplateArgs}{$obj}->$method;
$interpolated = 1;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment