Bugzilla – Attachment 171820 Details for
Bug 33339
Formula injection (CSV Injection) in export functionality
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33339: (Follow up) Fix more cases of formula=empty
Bug-33339-Follow-up-Fix-more-cases-of-formulaempty.patch (text/plain), 2.56 KB, created by
Marcel de Rooy
on 2024-09-20 07:14:04 UTC
(
hide
)
Description:
Bug 33339: (Follow up) Fix more cases of formula=empty
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2024-09-20 07:14:04 UTC
Size:
2.56 KB
patch
obsolete
>From 9728c8eb0fe6d7ddcf31b4d4b42eff1573f2c4ab Mon Sep 17 00:00:00 2001 >From: Magnus Enger <magnus@libriotech.no> >Date: Fri, 16 Aug 2024 14:59:20 +0200 >Subject: [PATCH] Bug 33339: (Follow up) Fix more cases of formula=empty >Content-Type: text/plain; charset=utf-8 > >This patch adds formula=empty to: >- Koha::ERM::EUsage::SushiCounter::_build_COUNTER_report_file() > >It also removes formula=empty from: >- C4::ImportExportFramework::_import_table_csv() >- Koha::Patrons::Import::generate_patron_attributes() >because in these places CSV is only read, not generated. Please >FQA if this is unwanted. > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > C4/ImportExportFramework.pm | 2 +- > Koha/ERM/EUsage/SushiCounter.pm | 2 +- > Koha/Patrons/Import.pm | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/ImportExportFramework.pm b/C4/ImportExportFramework.pm >index d02ec43d57..2f9739d8a3 100644 >--- a/C4/ImportExportFramework.pm >+++ b/C4/ImportExportFramework.pm >@@ -965,7 +965,7 @@ sub _import_table_csv > shift @fieldsPK; > my $ok = 0; > my $pos = 0; >- my $csv = Text::CSV_XS->new( { binary => 1, formula => "empty" } ); >+ my $csv = Text::CSV_XS->new( { binary => 1 } ); > while ( my $row = $csv->getline($dom) ) { > my @fields = @$row; > @arrData = @fields; >diff --git a/Koha/ERM/EUsage/SushiCounter.pm b/Koha/ERM/EUsage/SushiCounter.pm >index 4e33f8988f..10bde4ea21 100644 >--- a/Koha/ERM/EUsage/SushiCounter.pm >+++ b/Koha/ERM/EUsage/SushiCounter.pm >@@ -86,7 +86,7 @@ sub _build_COUNTER_report_file { > my @report = ( @{$header}, @{$column_headings}, @{$body} ); > > #TODO: change this to tab instead of comma >- csv( in => \@report, out => \my $counter_file, encoding => "utf-8" ); >+ csv( in => \@report, out => \my $counter_file, encoding => "utf-8", formula => 'empty' ); > > return $counter_file; > >diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm >index f4b5c2538e..ce4ae0eb53 100644 >--- a/Koha/Patrons/Import.pm >+++ b/Koha/Patrons/Import.pm >@@ -627,7 +627,7 @@ sub generate_patron_attributes { > push (@$feedback, { feedback => 1, name => 'attribute string', value => $string }); > return [] unless $string; # Unit tests want the feedback, is it really needed? > >- my $csv = Text::CSV->new( { binary => 1, formula => "empty" } ); # binary needed for non-ASCII Unicode >+ my $csv = Text::CSV->new( { binary => 1 } ); # binary needed for non-ASCII Unicode > my $ok = $csv->parse($string); # parse field again to get subfields! > my @list = $csv->fields(); > my @patron_attributes = >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33339
:
148717
|
153997
|
170719
|
170720
|
171810
|
171811
|
171819
|
171820
|
171961
|
172088
|
172089