mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-08 14:48:01 +08:00
issue #I4ZDQI 规范命名
This commit is contained in:
parent
a294582d05
commit
bdaad75554
@ -144,12 +144,12 @@ public class ZipReader implements Closeable {
|
|||||||
read((zipEntry) -> {
|
read((zipEntry) -> {
|
||||||
if (null == entryFilter || entryFilter.accept(zipEntry)) {
|
if (null == entryFilter || entryFilter.accept(zipEntry)) {
|
||||||
//gitee issue #I4ZDQI
|
//gitee issue #I4ZDQI
|
||||||
String replace = zipEntry.getName();
|
String path = zipEntry.getName();
|
||||||
if (System.getProperty("os.name").contains("Windows")) {
|
if (System.getProperty("os.name").contains("Windows")) {
|
||||||
replace = StrUtil.replace(zipEntry.getName(), "*", "_");
|
path = StrUtil.replace(zipEntry.getName(), "*", "_");
|
||||||
}
|
}
|
||||||
// FileUtil.file会检查slip漏洞,漏洞说明见http://blog.nsfocus.net/zip-slip-2/
|
// FileUtil.file会检查slip漏洞,漏洞说明见http://blog.nsfocus.net/zip-slip-2/
|
||||||
final File outItemFile = FileUtil.file(outFile, replace);
|
final File outItemFile = FileUtil.file(outFile, path);
|
||||||
if (zipEntry.isDirectory()) {
|
if (zipEntry.isDirectory()) {
|
||||||
// 目录
|
// 目录
|
||||||
//noinspection ResultOfMethodCallIgnored
|
//noinspection ResultOfMethodCallIgnored
|
||||||
|
Loading…
Reference in New Issue
Block a user