Skip to content

Commit

Permalink
feat: extend input compatibility to all steam id formats (advSearch)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackmastr committed Nov 10, 2024
1 parent d2aa6d3 commit d066b9e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
18 changes: 17 additions & 1 deletion web/pages/page.banlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ function setPostKey()
try {
SteamID::init();
if (SteamID::isValidID($searchText)) {
$searchText = SteamID::toSteam2($searchText);
$conversionResult = SteamID::toSteam2($searchText);

if ($conversionResult) {
$searchText = $conversionResult;
}
}
} catch (Exception $e) { }

Expand Down Expand Up @@ -292,6 +296,18 @@ function setPostKey()
$advcrit = [];
if (isset($_GET['advSearch'])) {
$value = trim($_GET['advSearch']);

try {
SteamID::init();
if (SteamID::isValidID($value)) {
$conversionResult = SteamID::toSteam2($value);

if ($conversionResult) {
$value = $conversionResult;
}
}
} catch (Exception $e) { }

$type = $_GET['advType'];
switch ($type) {
case "name":
Expand Down
19 changes: 17 additions & 2 deletions web/pages/page.commslist.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,17 @@ function setPostKey()
$hideinactiven = "";
}


if (isset($_GET['searchText'])) {
$searchText = trim($_GET['searchText']);

try {
SteamID::init();
if (SteamID::isValidID($searchText)) {
$searchText = SteamID::toSteam2($searchText);
$conversionResult = SteamID::toSteam2($searchText);

if ($conversionResult) {
$searchText = $conversionResult;
}
}
} catch (Exception $e) { }

Expand Down Expand Up @@ -287,6 +290,18 @@ function setPostKey()
$advcrit = [];
if (isset($_GET['advSearch'])) {
$value = trim($_GET['advSearch']);

try {
SteamID::init();
if (SteamID::isValidID($value)) {
$conversionResult = SteamID::toSteam2($value);

if ($conversionResult) {
$value = $conversionResult;
}
}
} catch (Exception $e) { }

$type = $_GET['advType'];
switch ($type) {
case "name":
Expand Down

0 comments on commit d066b9e

Please sign in to comment.