Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added proper SteamID2 and IP address validation to admin ban page / Switch to userid for kickid #485

Closed
wants to merge 10 commits into from

Conversation

geominorai
Copy link
Contributor

@geominorai geominorai commented Jun 19, 2018

Description

Replaces string length tests with regex tests
Fixes not allowing older Steam accounts with a shorter ID length
Includes alternate regex test for community IDs

Switched kickid to use userid instead of Steam ID due to command breakage for TF2 servers.

Motivation and Context

  • Prevents passing invalid Steam IDs and IP addresses that may cause errors later in the pipeline
  • Fixes players not being kicked after being banned via the admin ban page or kicked via the server list.

How Has This Been Tested?

Tested on Linux web server
Tested on Linux TF2 game server

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

@Groruk Groruk self-requested a review June 19, 2018 00:27
@geominorai geominorai changed the title Added proper SteamID2 and IP address validation to admin ban page Added proper SteamID2 and IP address validation to admin ban page / Switch to userid for kickid Jun 19, 2018
@geominorai
Copy link
Contributor Author

Added commits to switch to userid for the calls to the kickid command.

@geominorai
Copy link
Contributor Author

geominorai commented Jun 19, 2018

This will probably fix issue #474.

@geominorai
Copy link
Contributor Author

Renamed the for-loop variables by @codacy-bot's recommendations.

@sbpp sbpp deleted a comment Jun 19, 2018
@sbpp sbpp deleted a comment Jun 19, 2018
@geominorai
Copy link
Contributor Author

Fixed a bug where a SteamID2 conversion was attempted before checking for an empty string (such as for IP bans).

@sbpp sbpp deleted a comment Jun 19, 2018
@sbpp sbpp deleted a comment Jun 19, 2018

$steam = \SteamID\SteamID::toSteam2(trim($steam));
$steam = trim($steam);
if ($steam)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use empty() function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's acts the same for strings, but alright.

@sbpp sbpp deleted a comment Jun 19, 2018
@sbpp sbpp deleted a comment Jul 4, 2018
@geominorai
Copy link
Contributor Author

Pull has been abandoned and is too far behind master. I'll resync and recreate the patch and pull request.

@geominorai geominorai closed this Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants