Skip to content

Commit d066b9e

Browse files
committed
feat: extend input compatibility to all steam id formats (advSearch)
1 parent d2aa6d3 commit d066b9e

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

web/pages/page.banlist.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ function setPostKey()
228228
try {
229229
SteamID::init();
230230
if (SteamID::isValidID($searchText)) {
231-
$searchText = SteamID::toSteam2($searchText);
231+
$conversionResult = SteamID::toSteam2($searchText);
232+
233+
if ($conversionResult) {
234+
$searchText = $conversionResult;
235+
}
232236
}
233237
} catch (Exception $e) { }
234238

@@ -292,6 +296,18 @@ function setPostKey()
292296
$advcrit = [];
293297
if (isset($_GET['advSearch'])) {
294298
$value = trim($_GET['advSearch']);
299+
300+
try {
301+
SteamID::init();
302+
if (SteamID::isValidID($value)) {
303+
$conversionResult = SteamID::toSteam2($value);
304+
305+
if ($conversionResult) {
306+
$value = $conversionResult;
307+
}
308+
}
309+
} catch (Exception $e) { }
310+
295311
$type = $_GET['advType'];
296312
switch ($type) {
297313
case "name":

web/pages/page.commslist.php

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,17 @@ function setPostKey()
223223
$hideinactiven = "";
224224
}
225225

226-
227226
if (isset($_GET['searchText'])) {
228227
$searchText = trim($_GET['searchText']);
229228

230229
try {
231230
SteamID::init();
232231
if (SteamID::isValidID($searchText)) {
233-
$searchText = SteamID::toSteam2($searchText);
232+
$conversionResult = SteamID::toSteam2($searchText);
233+
234+
if ($conversionResult) {
235+
$searchText = $conversionResult;
236+
}
234237
}
235238
} catch (Exception $e) { }
236239

@@ -287,6 +290,18 @@ function setPostKey()
287290
$advcrit = [];
288291
if (isset($_GET['advSearch'])) {
289292
$value = trim($_GET['advSearch']);
293+
294+
try {
295+
SteamID::init();
296+
if (SteamID::isValidID($value)) {
297+
$conversionResult = SteamID::toSteam2($value);
298+
299+
if ($conversionResult) {
300+
$value = $conversionResult;
301+
}
302+
}
303+
} catch (Exception $e) { }
304+
290305
$type = $_GET['advType'];
291306
switch ($type) {
292307
case "name":

0 commit comments

Comments
 (0)