projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cb66e7c
)
remove trailing junk from XLSX files, #20337
author
Mark Wells
<mark@freeside.biz>
Wed, 28 Nov 2012 05:43:37 +0000
(21:43 -0800)
committer
Mark Wells
<mark@freeside.biz>
Wed, 28 Nov 2012 05:43:37 +0000
(21:43 -0800)
httemplate/graph/elements/report.html
patch
|
blob
|
history
httemplate/search/customer_accounting_summary.html
patch
|
blob
|
history
httemplate/search/elements/search-xls.html
patch
|
blob
|
history
httemplate/search/elements/search.html
patch
|
blob
|
history
httemplate/search/report_tax-xls.cgi
patch
|
blob
|
history
diff --git
a/httemplate/graph/elements/report.html
b/httemplate/graph/elements/report.html
index
98b4778
..
b7073db
100644
(file)
--- a/
httemplate/graph/elements/report.html
+++ b/
httemplate/graph/elements/report.html
@@
-126,8
+126,8
@@
any delimiter and linked from the elements in @data.
% $workbook->close();# or die "Error creating .xls file: $!";
%
% http_header('Content-Length' => length($output) );
% $workbook->close();# or die "Error creating .xls file: $!";
%
% http_header('Content-Length' => length($output) );
-%
-<% $output %>
+%
$m->print($output);
+%
% } elsif ( $cgi->param('_type') eq 'png' ) {
% # delete any items that shouldn't be on the graph
% if ( my $no_graph = $opt{'no_graph'} ) {
% } elsif ( $cgi->param('_type') eq 'png' ) {
% # delete any items that shouldn't be on the graph
% if ( my $no_graph = $opt{'no_graph'} ) {
diff --git
a/httemplate/search/customer_accounting_summary.html
b/httemplate/search/customer_accounting_summary.html
index
5ce2e3a
..
5575283
100644
(file)
--- a/
httemplate/search/customer_accounting_summary.html
+++ b/
httemplate/search/customer_accounting_summary.html
@@
-73,9
+73,11
@@
$r++;
} #$row
$workbook->close;
$r++;
} #$row
$workbook->close;
+
+ http_header('Content-Length' => length($output));
+ $m->print($output);
</%perl>
</%perl>
-<% $output %>
-% } else {
+% } else {
<& /elements/header.html, $title &>
% my $myself = $cgi->self_url;
<P ALIGN="right" CLASS="noprint">
<& /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
94d88b0
..
26a51c4
100644
(file)
--- a/
httemplate/search/elements/search-xls.html
+++ b/
httemplate/search/elements/search-xls.html
@@
-1,4
+1,3
@@
-<% $data %>
<%init>
my %args = @_;
<%init>
my %args = @_;
@@
-148,5
+147,6
@@
if ( $opt{'footer'} ) {
$workbook->close();# or die "Error creating .xls file: $!";
http_header('Content-Length' => length($data) );
$workbook->close();# or die "Error creating .xls file: $!";
http_header('Content-Length' => length($data) );
+$m->print($data);
</%init>
</%init>
diff --git
a/httemplate/search/elements/search.html
b/httemplate/search/elements/search.html
index
eca68a2
..
5a16a22
100644
(file)
--- a/
httemplate/search/elements/search.html
+++ b/
httemplate/search/elements/search.html
@@
-176,7
+176,9
@@
Example:
%
% } elsif ( $type =~ /\.xls$/ ) {
%
%
% } 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' ) {
%
%
% } elsif ( $type eq 'xml' ) {
%
diff --git
a/httemplate/search/report_tax-xls.cgi
b/httemplate/search/report_tax-xls.cgi
index
f19f85a
..
bb843a7
100755
(executable)
--- 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');
<%init>
my $htmldoc = include('report_tax.cgi');
@@
-155,4
+154,6
@@
for my $x (0..scalar(@widths)-1) {
$workbook->close;
$workbook->close;
+http_header('Content-Length' => length($data));
+$m->print($data);
</%init>
</%init>