-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xlsx Reader parse quotePrefix attribute error #3435
Comments
I think that you are theoretically correct. Excel omits |
@oleibman You are right! My mistake. I'm using PhpSpreadsheet for a long time without error until dealing with a file download from Amazon Sellercentral: ManifestFileUpload_Template_MPL.xlsx It uses include 'vendor/autoload.php';
$inputFileName = '/path/to/ManifestFileUpload_Template_MPL.xlsx';
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($inputFileName);
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($spreadsheet);
$writer->save('/path/to/ManifestFileUpload_Template_MPL-new.xlsx'); |
Fix PHPOffice#3435. Mis-parsed attribute is not normally generated by Excel or PhpSpreadsheet, but some 3rd-party software (correctly) generates it.
Thank you for the sample file. If you can test against PR 3438, please do so. |
I have confirmed that PR 3438 works correctly with my ManifestFileUpload_Template_MPL.xlsx |
* Correct Xlsx Parsing of quotePrefix="0" Fix #3435. Mis-parsed attribute is not normally generated by Excel or PhpSpreadsheet, but some 3rd-party software (correctly) generates it. * Update Issue3435Test.php
This is:
What is the expected behavior?
Load
quotePrefix
CorrectlyWhat is the current behavior?
What are the steps to reproduce?
Source code: https://github.com/PHPOffice/PhpSpreadsheet/blob/master/src/PhpSpreadsheet/Reader/Xlsx.php#L621
test code:
the source xml has two xf tags with
quotePrefix="0"
andquotePrefix="1"
butvar_dump((bool) ($xf['quotePrefix'] ?? false));
both returntrue
.Should
$xf['quotePrefix']
be converted to string first?What features do you think are causing the issue
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
Xlsx
Which versions of PhpSpreadsheet and PHP are affected?
PhpSpreadsheet: All
PHP: I am using 7.4.33
The text was updated successfully, but these errors were encountered: