diff options
-rwxr-xr-x | LedgerSMB/Template.pm | 12 | ||||
-rw-r--r-- | UI/Contact/contact.html | 18 |
2 files changed, 20 insertions, 10 deletions
diff --git a/LedgerSMB/Template.pm b/LedgerSMB/Template.pm index 4a694312..e66bcfd9 100755 --- a/LedgerSMB/Template.pm +++ b/LedgerSMB/Template.pm @@ -256,8 +256,16 @@ sub render { $cleanvars->{text} = sub { return $self->{locale}->text(@_)}; } else { - $cleanvars->{text} = sub { return shift @_ }; - } + $cleanvars->{text} = sub { return shift @_ }; + + } + $cleanvars->{tt_url} = sub { + my $str = shift @_; + + my $regex = qr/([^a-zA-Z0-9_.-])/; + $str =~ s/$regex/sprintf("%%%02x", ord($1))/ge; + return $str; + }; $format->can('process')->($self, $cleanvars); #return $format->can('postprocess')->($self); diff --git a/UI/Contact/contact.html b/UI/Contact/contact.html index 08e4ce5b..2d15adc1 100644 --- a/UI/Contact/contact.html +++ b/UI/Contact/contact.html @@ -594,17 +594,19 @@ problems with multi-word single-quoted constructs in PI tags. -CT --> <td class="contact_class"><?lsmb ct.class ?></td> <td class="contact"><?lsmb ct.contact ?></td> <td class="contact_actions"> - <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id - ?>&contact=<?lsmb ct.contact - ?>&contact_class=<?lsmb ct.class_id - ?>&description=<?lsmb ct.description + <a href="<?lsmb tt_url(script) + ?>?entity_id=<?lsmb tt_url(entity_id) + ?>&contact=<?lsmb tt_url(ct.contact) + ?>&contact_class=<?lsmb tt_url(ct.class_id) + ?>&description=<?lsmb tt_url(ct.description) ?>&action=edit&credit_id=<?lsmb - credit_id ?>" + tt_url(credit_id) ?>" >[<?lsmb text('Edit'); ?>]</a> - <a href="<?lsmb script ?>?entity_id=<?lsmb entity_id - ?>&contact_id=<?lsmb ct.id + <a href="<?lsmb tt_url(script) + ?>?entity_id=<?lsmb tt_url(entity_id) + ?>&contact_id=<?lsmb tt_url(ct.id) ?>&action=delete_contact&credit_id=<?lsmb - credit_id ?>" + tt_url(credit_id) ?>" >[<?lsmb text('Delete'); ?>]</a> </td> </tr> |