From ec75f85155808bb60f5e1c593754471ad2a398f1 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 21 Aug 2008 20:21:11 +0000 Subject: Correcting issues retrieving contact info which contain '#' in description or contact info. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2297 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Template.pm | 12 ++++++++++-- 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 --> - ?entity_id=&contact=&contact_class=&description=&action=edit&credit_id=" + tt_url(credit_id) ?>" >[]   - ?entity_id=&contact_id=&action=delete_contact&credit_id=" + tt_url(credit_id) ?>" >[] -- cgit v1.2.3