简体   繁体   中英

PHP PHAR having problems with filenames with multiple dots

I'm trying to extract some files out of a tar.gz file.

But the filename seems to cause problems:

xxx.some-random-number.tar.gz

When I use \\PharData::isValidPharFilename('xxx.some-random-number.tar.gz', false) the function returns false. When I omit the first part (ie \\PharData::isValidPharFilename('some-random-number.tar.gz', false) it returns true.

I can't use different filenames as they are provided from a third-party service (and I don't wanna rename them on the fly, either (tedious).

Any ideas how to solve this?

I believe the extension needs to be phar, tar or zip. I just answered a similar question here where I provided a bit more detail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM