Commit 19c36a6a authored by Shawn Moore's avatar Shawn Moore
Browse files

Simplify and clarify filling in template params

git-svn-id: svn+ssh://svn.bestpractical.com/svn/bps-public/rt/3.8/trunk@19594 e417ac7c-1bcc-0310-8ffa-8f5827389a85
parent d7a9b2a4
......@@ -219,17 +219,20 @@ sub _FillInTemplateURL {
my $self = shift;
my $url = shift;
my $id = $self->ObjectId;
my $content = join '', @{[$self->Content]};
my %placeholders = (
id => $self->ObjectId,
CustomField => $self->Content,
);
# default value, uri-escape
for ($id, $content) {
$_ = '' if !defined($_);
RT::Interface::Web::EscapeURI(\$_);
}
for my $key (keys %placeholders) {
my $value = $placeholders{$key};
$url =~ s/__id__/$id/g;
$url =~ s/__CustomField__/$content/g;
$value = '' if !defined($value);
RT::Interface::Web::EscapeURI(\$value);
$url =~ s/__${key}__/$value/g;
}
return $url;
}
......
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