Problem/Motivation

The module is not compatible with PhpSpreadsheet library version > 1.12.0
tested with versions 1.13.0 to 1.17.1 (current).

When trying to export, it either don't generate the file or downloads a corrupted one. It doen't raise any drupal or php error.

Steps to reproduce

Install the module (dev or 8.x-1.0) attempts to export submissions.

Proposed resolution

A workarround is to install phpspreadsheet while constraining the version prior to install the module.
composer require phpoffice/phpspreadsheet:1.12.0

As lib version 1.16.0 fixes a CVE (that seems mitigated in this case) fixing incompatibility that start at 1.13.0 would be the preferable fix.

Assuming the CVE is really irrelevant, constraining dependencies in module's composer.json, could help as a quick fix but requires to make sure of it.

Comments

ericdsd created an issue. See original summary.

prudloff’s picture

Thanks for the report.
I am using phpspreadsheet 1.16 or 1.17 on several projects and could not reproduce the error. There might be some conditions (PHP version, row content, etc.) that triggers it.

As for CVE-2020-7776, it seems to only apply when converting an Excel file to HTML (and this module never does that). But I agree that it would be better to fix your bug than pinning an old version.

ericdsd’s picture

Thanks for the reply, i tesed it on php 7.3, with several forms including very simple ones. Don't hesitate to tell me if you want me to test a patch.

ahmad smhan’s picture

This path to solve this issue

ahmad smhan’s picture

Status: Active » Needs review
facine’s picture

Status: Needs review » Reviewed & tested by the community

It works for me, many thanks!

rosk0’s picture

Just tested on Drupal 9.5.3, PHP 8.0.27, webform_xlsx_export 1.1.0 and phpoffice/phpspreadsheet 1.28.0 - works as expected without this patch.

prudloff’s picture

Status: Reviewed & tested by the community » Fixed

I still can't reproduce the bug, but the patch seems harmless so I committed it.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.