sourcebans-pp icon indicating copy to clipboard operation
sourcebans-pp copied to clipboard

[Web] - Missing octet in IP

Open Rushaway opened this issue 2 years ago • 4 comments

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

Rushaway avatar Feb 27 '23 07:02 Rushaway

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 avatar Mar 04 '23 06:03 BitmapDummy

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

BitmapDummy avatar Mar 16 '23 01:03 BitmapDummy

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.]+)/';

F1F88 avatar Jul 14 '23 17:07 F1F88

That fixed it, thanks!

BitmapDummy avatar Mar 23 '24 10:03 BitmapDummy