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
333 stars 174 forks source link

[Web] - Missing octet in IP #865

Closed Rushaway closed 3 months ago

Rushaway commented 1 year ago

What are the steps to reproduce this issue?

  1. Login
  2. Go on servers page
  3. Right click on an user, select ban
  4. 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

BitmapDummy commented 1 year ago

When banning someone from the servers list the filled IP address is missing the first octet. image (Actual details here are fake, but it basically shows what happens.)

BitmapDummy commented 1 year ago

This can also be found when you:

  1. Join a server that you are assigned as an admin to
  2. Login to sourcebans
  3. Admin Panel
  4. Servers
  5. Click the Admins button for the server you're connected to
  6. Click the row for the connected admin to open admin details ingame
  7. See the IP Address of the connected admin

image

F1F88 commented 1 year ago

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.]+)/';
BitmapDummy commented 5 months ago

That fixed it, thanks!