[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-189-g5591079
Shawn Moore
sartak at bestpractical.com
Wed Jul 21 00:14:08 EDT 2010
The branch, new-style-templates has been updated
via 55910793b86db6044f91eab269cc1c115414c8a0 (commit)
from 7233d347093527c0cd265b7ac30bc2854b4962b0 (commit)
Summary of changes:
lib/RT/Template_Overlay.pm | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
- Log -----------------------------------------------------------------
commit 55910793b86db6044f91eab269cc1c115414c8a0
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Wed Jul 21 00:15:42 2010 -0400
Strengthen the object test from exists to blessed
Otherwise, ->can throws an error
diff --git a/lib/RT/Template_Overlay.pm b/lib/RT/Template_Overlay.pm
index 301b066..9fc5e97 100755
--- a/lib/RT/Template_Overlay.pm
+++ b/lib/RT/Template_Overlay.pm
@@ -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;
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list