From: gmc Date: Wed, 29 Sep 2010 17:48:52 +0000 (+0000) Subject: reporter: don't try to write Excel formulas X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a14c6215d20fb64ea9174fc373d6057205f5fd6b;p=evergreen%2Fbjwebb.git reporter: don't try to write Excel formulas Any cell value that starts with = is now always written as a text cell in spreadsheet output. Avoids a possible exploit as well as errors like this: Couldn't parse formula: = at /openils/bin/clark-kent.pl line 429 Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/trunk@18101 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/reporter/clark-kent.pl b/Open-ILS/src/reporter/clark-kent.pl index 52dc6fd90..196297e34 100755 --- a/Open-ILS/src/reporter/clark-kent.pl +++ b/Open-ILS/src/reporter/clark-kent.pl @@ -423,6 +423,8 @@ sub build_excel { $sheetname =~ s/\W/_/gos; my $sheet = $xls->add_worksheet($sheetname); + # don't try to write formulas, just write anything that starts with = as a text cell + $sheet->add_write_handler(qr/^=/, sub { return shift->write_string(@_); } ); $sheet->write_row('A1', $r->{column_labels});