Closed arnapou closed 7 months ago
Hello,
Thanks for sharing. I don't understand what issue you're trying to fix here, could you expand on that please?
Sorry if I was not clear.
To me :
0x061E
, not 0x0603
. Either you want to put the Pkware version then something like 0x063F
.0x0E
(to be more tested than what I did)@arnapou Thanks for your detailed analysis.
I'm generally open to adjust those things, but I'm also a bit apprehensive about it since we've had a lot of issues with various unarchiving tools and what we have right now seems to work with most of them.
If we change this, I would propose to add a config flag to enable the new behavior and see how it affects people before applying it for everyone.
I understand, that's why I wasnβt confident in doing a PR. But I couldn't pass my way too.
[!note] These suggestions are not technically necessary to make ZipStream work.
The thing is, I'm a bit technically picky and I wanted to pass these information to you.
:point_right: Up to you to:
:hugs:
I agree with @maennchen, if it ain't broken, don't fix it. I'm also afraid that this will have consequences, so it's best to leave it like that, except maybe the phpdoc because this cannot have an impact on users.
Your lib, your choice π
I agree :100: with "if it ain't broken, don't fix it", but beware of tons of dust to clean after a few years π
π π
PS: feel free to reopen or reach me if needed.
Hello,
I developed my own code about this subject of streaming zip when I discovered there was already this lib. I didn't want to rewrite all my code, but I played with your lib to compare things.
In all humility, I may have discovered several possible issues which all started about the
ZIP_VERSION_MADE_BY
constant. I read the #84 but I still think it could be nice to bring to you what I discovered.Zip test
Write a file
zipinfo on it
Issue 1: very old documentation
ZipStream
You use in the phpdoc this link https://www.iana.org/assignments/media-types/application/zip
Date: (Jul 20, 93)
Pkware
I read the following doc https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
Date: (Nov 01, 2022)
Issue 2: change the lower byte of ZIP_VERSION_MADE_BY
0x0603
0x063F
0x3F
=63
=6.3
which is 18 years old (Sept 29, 2006) if I understand properly the Pkware doc.(tested with zipinfo : the number is accurate)
Issue 3: change the upper byte of ZIP_VERSION_MADE_BY
I am less confident here about this because I couldn't test it on every platform. I used it under ubuntu (GUI, cli, ...).
0x0603
0x0E3F
0x0E
=14
which correspond to VFAT regarding the Pkware doc.Finally
I can make a accordingly PR if you think that's useful : let me know ππ». I wanted your feedback before doing it because I may have missed important things regarding backward compatibility of your lib.