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

关于上传图片出现rand() expects parameter 2 to be integer, float given #48

Open
ningge123 opened this issue Jan 3, 2018 · 1 comment

Comments

@ningge123
Copy link

由于使用的是PHP7, 从错误提示中我们不难发现rand第二个参数想要一个int类型的参数,而传入的是float类型的.
出错原因:上面参数显然已经超出了int取值的最大范围,PHP本身为弱类型语言,将传入的参数当做了float传入了函数因此才有了这个报错问题.

找寻源码发现在Upload类,getFullName方法里 $randNum = rand(1, 10000000000) . rand(1, 10000000000);,建议尽快修复这个bug

@xuyudong
Copy link

我也发现了这个问题,自己去vendor里面把随机的数字改小了

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