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

Fix: #900 & #906 #908

Closed Rushaway closed 4 months ago

Rushaway commented 1 year ago

Description

Check if the Steamid format is valid by using isValidID() from SteamID.php

For #900 I check if isset & is not empty (bcs they can be empty with sm_banip) For #906 No need to check if set bcs all comms are based on steamid system (no ip supported)

Motivation and Context

Prevent bad format to break page view. Give this $data['steamid'] = 'STEAM_0:0:00000000'; when the isValid return false.

How Has This Been Tested?

For #900 I have a ban in db with STEAM_ID_STOP_IGNORING_RETVALS as SteamID in authid colume (also tested with a player name..) For #906 I have a comms in db with STEAM_ID_STOP_IGNORING_RETVALS as SteamID in authid colume

Screenshots (if appropriate):

Types of changes

Checklist:

Rushaway commented 1 year ago

nb: 3b1c56b I was thinking break can be a nice alt, but it's not a suitable solution

conorab commented 1 year ago

I had this issue as well. I accidentally banned one of the bots in Left 4 Dead 2 in-game and 'BOT' was added to the ban as their SteamID. This was fine pre-1.7 but causes the page to refuse to load now. Fixed by running the following MySQL commands ('sourcebans' being my database): USE sourcebans DELETE FROM sb_bans WHERE authid = 'BOT';