summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-11-27 21:43:37 -0800
committerMark Wells <mark@freeside.biz>2012-11-27 21:43:37 -0800
commit226fffec6fd0154ea8798b58321d4d119341879f (patch)
treef1cbbf032f75d0f566fa06f514fe0194a5649c28 /httemplate/search
parentcb66e7cac35892a482cf07c7e05db5ff6296c395 (diff)
remove trailing junk from XLSX files, #20337
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/customer_accounting_summary.html6
-rw-r--r--httemplate/search/elements/search-xls.html2
-rw-r--r--httemplate/search/elements/search.html4
-rwxr-xr-xhttemplate/search/report_tax-xls.cgi3
4 files changed, 10 insertions, 5 deletions
diff --git a/httemplate/search/customer_accounting_summary.html b/httemplate/search/customer_accounting_summary.html
index 5ce2e3a8f..557528325 100644
--- a/httemplate/search/customer_accounting_summary.html
+++ b/httemplate/search/customer_accounting_summary.html
@@ -73,9 +73,11 @@
$r++;
} #$row
$workbook->close;
+
+ http_header('Content-Length' => length($output));
+ $m->print($output);
</%perl>
-<% $output %>
-% } else {
+% } else {
<& /elements/header.html, $title &>
% my $myself = $cgi->self_url;
<P ALIGN="right" CLASS="noprint">
diff --git a/httemplate/search/elements/search-xls.html b/httemplate/search/elements/search-xls.html
index 94d88b096..26a51c4c7 100644
--- a/httemplate/search/elements/search-xls.html
+++ b/httemplate/search/elements/search-xls.html
@@ -1,4 +1,3 @@
-<% $data %>
<%init>
my %args = @_;
@@ -148,5 +147,6 @@ if ( $opt{'footer'} ) {
$workbook->close();# or die "Error creating .xls file: $!";
http_header('Content-Length' => length($data) );
+$m->print($data);
</%init>
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index eca68a2f8..5a16a22fe 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -176,7 +176,9 @@ Example:
%
% } elsif ( $type =~ /\.xls$/ ) {
%
-<% include('search-xls.html', header=>$header, rows=>$rows, opt=>\%opt ) %>
+<& 'search-xls.html', header=>$header, rows=>$rows, opt=>\%opt &>\
+% # prevent the caller from polluting our output stream
+% $m->abort;
%
% } elsif ( $type eq 'xml' ) {
%
diff --git a/httemplate/search/report_tax-xls.cgi b/httemplate/search/report_tax-xls.cgi
index f19f85aaa..bb843a73f 100755
--- a/httemplate/search/report_tax-xls.cgi
+++ b/httemplate/search/report_tax-xls.cgi
@@ -1,4 +1,3 @@
-<% $data %>
<%init>
my $htmldoc = include('report_tax.cgi');
@@ -155,4 +154,6 @@ for my $x (0..scalar(@widths)-1) {
$workbook->close;
+http_header('Content-Length' => length($data));
+$m->print($data);
</%init>