sbpp / sourcebans-pp

Admin, ban, and comms management system for the Source engine
https://sbpp.github.io/
Creative Commons Attribution Share Alike 4.0 International
327 stars 175 forks source link

PHP Deprecated: Implicit conversion from float 4294966783 to int loses precision #934

Closed zhu84586625 closed 7 months ago

zhu84586625 commented 7 months ago

Hello everyone, after installation, when I log in to my administrator account and click When "bans" occurs, the following alert will appear.

PHP Deprecated: Implicit conversion from float 4294966783 to int loses precision in D:\web\xxxxxx\web\includes\CUserManager.php on line 137

However, logging out of the administrator account allows for normal access!

I am not familiar with PHP and cannot solve this problem. Can someone help me?

configuration: PHP8.1 MYSQL5.6

Rushaway commented 7 months ago

Hello. We need the version of your sourcebans web panel. Also if you can put the content of the line who have the issue it may help us.

Rushaway commented 7 months ago

Could you try to modify the line 137 return ($this->admins[$aid]['extraflags'] & $flags) != 0 ? true : false; with this code: return ((int)$this->admins[$aid]['extraflags'] & (int)$flags) != 0 ? true : false; and give me feedback if that solve the issue. You didnt give step to reproduct so i cant check by myself.

zhu84586625 commented 7 months ago

Thank you for your help. I did as you said and the problem was solved!

你能试着修改137行吗return ($this->admins[$aid]['extraflags'] & $flags) != 0 ? true : false;使用此代码:return ((int)$this->admins[$aid]['extraflags'] & (int)$flags) != 0 ? true : false;如果这解决了问题,请给我反馈。你没有采取步骤进行复制,所以我无法亲自检查。

Thank you for your help. I did as you said and the problem was solved!