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

关于文件上传的后缀包含与排除问题 #274

Open
BLCheung opened this issue Jan 17, 2022 · 2 comments
Open

关于文件上传的后缀包含与排除问题 #274

BLCheung opened this issue Jan 17, 2022 · 2 comments

Comments

@BLCheung
Copy link

分支:master
在AbstractUploader上传基类里面,发现在进行文件后缀的包含与排除判断时,两个方法都采用了相同的判断逻辑,按道理findInExclude()内部循环的时候应该是equals返回false,最后返回true吧;请问这是否正确?
image

@fuhaodev
Copy link

fuhaodev commented Mar 14, 2022

没错的,这里是排除的意思,当然要判断是否相等了,返回true就是排除,返回false就是不排除,你在想想

@BLCheung
Copy link
Author

image
你可以看下这两方法的上层方法哦,他们都统一进行了一个取反操作,这会导致如果我只有exclude的话,如果findInExclude()检测到有需要排除的扩展名并返回true的话,checkExt()直接取反就跳过异常检测了,结果就是我上传的文件内包含有需要被排除的扩展名,也可以通过校验上传了

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