1
0
mirror of https://github.com/PurpleI2P/regi2p.git synced 2025-02-11 15:54:13 +00:00

fix domain validator, search with "alive" ("a") option in GET

This commit is contained in:
R4SAS 2022-08-26 17:29:19 +00:00
parent c43451e7d0
commit 4a7ffab927
3 changed files with 5 additions and 6 deletions

View File

@ -48,4 +48,3 @@ class Checker implements Task {
return $ts; return $ts;
} }
} }

View File

@ -168,12 +168,12 @@ class Utils {
return false; return false;
} }
if(filter_var($data, FILTER_VALIDATE_DOMAIN) !== false && preg_match('/\.i2p$/', $data)) { if(filter_var($data, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false || !preg_match('/\.i2p$/', $data)) {
return true; $result = "Domain is not valid. The label must be less than 63 characters long, contain only alphanumerics or hyphens and end with .i2p.";
return false;
} }
$result = "Domain is not valid. Check if you domain label is lesser than 63 chars and it ends with .i2p."; return true;
return false;
} }
public static function verifyHostRecord(string $data, &$output): bool { public static function verifyHostRecord(string $data, &$output): bool {

View File

@ -25,7 +25,7 @@ if (isset($query) && strlen($query) > 67 || isset($_POST["q"]) && strlen($_POST[
$q = htmlspecialchars($_POST["q"]); $q = htmlspecialchars($_POST["q"]);
} }
if (isset($_POST["a"])) if (isset($_POST["a"]) || isset($_GET["a"]))
$a = true; $a = true;
if (isset($_POST["all"]) || isset($_GET["all"])) if (isset($_POST["all"]) || isset($_GET["all"]))