X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FMason.pm;h=4c8c808cd9659d74f164f15a02ef8426f9737578;hb=cc9855d8e52fe35a362f7bda01616d53f04a7aab;hp=7e9827cac1981620aea5eead232c77a85c12e288;hpb=bcff37f04c502c60fea1e2824841eb2007a07ccd;p=freeside.git diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm index 7e9827cac..4c8c808cd 100644 --- a/FS/FS/Mason.pm +++ b/FS/FS/Mason.pm @@ -70,6 +70,7 @@ if ( -e $addl_handler_use_file ) { use HTML::Entities; use HTML::TreeBuilder; use HTML::FormatText; + use HTML::Defang; use JSON; use MIME::Base64; use IO::Handle; @@ -174,6 +175,7 @@ if ( -e $addl_handler_use_file ) { use FS::part_export; use FS::part_export_option; use FS::export_svc; + use FS::export_device; use FS::msgcat; use FS::rate; use FS::rate_region; @@ -226,6 +228,11 @@ if ( -e $addl_handler_use_file ) { use FS::cust_category; use FS::prospect_main; use FS::contact; + use FS::svc_pbx; + use FS::discount; + use FS::cust_pkg_discount; + use FS::cust_bill_pkg_discount; + use FS::svc_mailinglist; # Sammath Naur if ( $FS::Mason::addl_handler_use ) { @@ -402,6 +409,8 @@ I should be set to a scalar reference in standalone mode. =cut +my %defang_opts = ( attribs_to_callback => ['src'], attribs_callback => sub { 1 }); + sub mason_interps { my $mode = shift || 'apache'; my %opt = @_; @@ -445,6 +454,8 @@ sub mason_interps { $interp{out_method} = $opt{outbuf} if $mode eq 'standalone' && $opt{outbuf}; + my $html_defang = new HTML::Defang (%defang_opts); + my $fs_interp = new HTML::Mason::Interp ( %interp, escape_flags => { 'js_string' => sub { @@ -452,7 +463,10 @@ sub mason_interps { ${$_[0]} =~ s/(['\\])/\\$1/g; ${$_[0]} =~ s/\n/\\n/g; ${$_[0]} = "'". ${$_[0]}. "'"; - } + }, + 'defang' => sub { + ${$_[0]} = $html_defang->defang(${$_[0]}); + }, }, compiler => HTML::Mason::Compiler::ToObject->new( allow_globals => [qw(%session)],