[Web] - Missing octet in IP
What are the steps to reproduce this issue?
- Login
- Go on servers page
- Right click on an user, select ban
- The first octet of the IP is missing
What happens?
The first octet of the IP is missing
What were you expecting to happen?
Have full IP.
Any logs, error output, etc.?
No errors on client & server side.
Any other comments?
N/A
What versions of software are you using?
Operating System: nginx SourceBans++ Version: 1.8.0 (php 8.1 branch) with the lastest release. PHP Version: 8.1.16 MySQL Version: 10.6.7-MariaDB-2ubuntu1 - Ubuntu 22.04 Link to your project: https://bans.nide.gg/index.php Link to a phpinfo() output: https://upgradebans.nide.gg/phpinfo.php
When banning someone from the servers list the filled IP address is missing the first octet.
(Actual details here are fake, but it basically shows what happens.)
This can also be found when you:
- Join a server that you are assigned as an admin to
- Login to sourcebans
- Admin Panel
- Servers
- Click the Admins button for the server you're connected to
- Click the row for the connected admin to open admin details ingame
- See the IP Address of the connected admin

It should be a bug with a regular expression matching error.
You can try modifying this line in includes/system-functions.php
https://github.com/sbpp/sourcebans-pp/blob/8327d11807db3d300ce062625ac5ae5ca75f214c/web/includes/system-functions.php#L381
Modify to:
$regex = '/#\s*(\d+)(?>\s|\d)*"(.*)"\s*(STEAM_[01]:[01]:\d+|\[U:1:\d+\])(?>\s|:|\d)*[a-zA-Z]*\s*\d*\s([0-9.]+)/';
That fixed it, thanks!