summaryrefslogtreecommitdiffstats
path: root/lib/Spreadsheet/ParseXLSX.pm
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2016-05-22 03:15:48 -0400
committerJesse Luehrs <doy@tozt.net>2016-05-22 03:18:34 -0400
commit5af52b992a3ea7298f302814a332609da3bf8125 (patch)
treec6bf77ee4535c1c6a1e9289ca1caa9429a46f6a0 /lib/Spreadsheet/ParseXLSX.pm
parent19c787c43a7559189c12b89bfe4523e012a6ec1d (diff)
downloadspreadsheet-parsexlsx-5af52b992a3ea7298f302814a332609da3bf8125.tar.gz
spreadsheet-parsexlsx-5af52b992a3ea7298f302814a332609da3bf8125.zip
better error message when loading xls files (#52)
encrypted xlsx files use the same file container format as xls files, and so our simple heuristic here will identify xls files as encrypted xlsx files - we should bail out if we can't find encrypted data instead
Diffstat (limited to 'lib/Spreadsheet/ParseXLSX.pm')
-rw-r--r--lib/Spreadsheet/ParseXLSX.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Spreadsheet/ParseXLSX.pm b/lib/Spreadsheet/ParseXLSX.pm
index a9b501f..cf9319a 100644
--- a/lib/Spreadsheet/ParseXLSX.pm
+++ b/lib/Spreadsheet/ParseXLSX.pm
@@ -71,10 +71,11 @@ sub parse {
my $workbook = Spreadsheet::ParseExcel::Workbook->new;
if ($self->_check_signature($file)) {
- $file = Spreadsheet::ParseXLSX::Decryptor->open(
+ my $decrypted_file = Spreadsheet::ParseXLSX::Decryptor->open(
$file,
$self->{Password}
);
+ $file = $decrypted_file if $decrypted_file;
}
if (openhandle($file)) {