Skip to content
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

getCrc() fails sometimes #30

Open
wapmorgan opened this issue Jul 1, 2022 · 3 comments
Open

getCrc() fails sometimes #30

wapmorgan opened this issue Jul 1, 2022 · 3 comments
Assignees

Comments

@wapmorgan
Copy link
Contributor

For few archive types, CRC is not parsed from 7z l, so it is empty, so it fails with Exception

Fatal error: Uncaught TypeError: Archive7z\Entry::getCrc(): Return value must be of type string, null returned in /app/vendor/gemorroj/archive7z/src/Entry.php:240
Stack trace:
#0 /app/src/Drivers/SevenZip.php(217): Archive7z\Entry->getCrc()
#1 /app/src/UnifiedArchive.php(284): wapmorgan\UnifiedArchive\Drivers\SevenZip->getFileData('doc')
#2 /app/src/Commands/TableCommand.php(66): wapmorgan\UnifiedArchive\UnifiedArchive->getFileData('doc')

I found that crc is present for ZIP/TAR.GZ, and not present for TAR

@wapmorgan
Copy link
Contributor Author

And for ISO files there's another problem: Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /app/vendor/gemorroj/archive7z/src/Entry.php on line 189.
Output of /usr/bin/7z command 7zl.txt attached

@wapmorgan
Copy link
Contributor Author

And even empty Path:

TypeError: Archive7z\Entry::getPath(): Return value must be of type string, null returned

/app/vendor/gemorroj/archive7z/src/Entry.php:278
/app/vendor/gemorroj/archive7z/src/Entry.php:283
/app/src/Drivers/SevenZip.php:171
/app/tests/DriversTest.php:110

for listing file https://github.com/wapmorgan/UnifiedArchive/releases/download/0.0.1/onefile.xz

@Gemorroj Gemorroj self-assigned this Jul 5, 2022
Gemorroj added a commit that referenced this issue Jul 5, 2022
@Gemorroj
Copy link
Owner

Gemorroj commented Jul 5, 2022

@wapmorgan tnx. i have fixed some problems except empty path in xz archive. i will think about how to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants