summaryrefslogtreecommitdiff
path: root/LedgerSMB/Template/HTML.pm
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB/Template/HTML.pm')
-rwxr-xr-xLedgerSMB/Template/HTML.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/LedgerSMB/Template/HTML.pm b/LedgerSMB/Template/HTML.pm
index 340b6c94..9159098e 100755
--- a/LedgerSMB/Template/HTML.pm
+++ b/LedgerSMB/Template/HTML.pm
@@ -39,6 +39,9 @@ holders, see the CONTRIBUTORS file.
package LedgerSMB::Template::HTML;
+use warnings;
+use strict;
+
use Error qw(:try);
use CGI::Simple::Standard qw(:html);
use Template;
@@ -56,12 +59,15 @@ sub preprocess {
#XXX fix escaping function
return $rawvars if $type =~ /^LedgerSMB::Locale/;
+ return unless defined $rawvars;
if ( $type eq 'ARRAY' ) {
for (@{$rawvars}) {
push @{$vars}, preprocess( $_ );
}
} elsif (!$type) {
return escapeHTML($rawvars);
+ } elsif ($type eq 'SCALAR') {
+ return escapeHTML($$rawvars);
} else { # Hashes and objects
for ( keys %{$rawvars} ) {
$vars->{preprocess($_)} = preprocess( $rawvars->{$_} );