2023-08-10 12:36:39 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$domain = $_GET['domain'] ?? '';
|
|
|
|
|
2024-06-24 15:32:14 +03:00
|
|
|
if (!str_contains($domain, '.')) {
|
2023-08-10 12:36:39 +03:00
|
|
|
http_response_code(400);
|
2024-06-24 15:32:14 +03:00
|
|
|
} elseif (str_contains($domain, '/')) {
|
2023-08-10 12:36:39 +03:00
|
|
|
http_response_code(400);
|
2024-06-24 15:32:14 +03:00
|
|
|
} elseif (str_contains($domain, ':')) {
|
2023-08-10 12:36:39 +03:00
|
|
|
http_response_code(400);
|
2024-01-25 14:17:43 +03:00
|
|
|
} elseif (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {
|
2023-08-10 12:36:39 +03:00
|
|
|
http_response_code(400);
|
|
|
|
} elseif (filter_var($domain, FILTER_VALIDATE_IP)) {
|
|
|
|
http_response_code(400);
|
|
|
|
} else {
|
2023-08-10 16:46:40 +03:00
|
|
|
// Commented because logging is disabled as otherwise all attempts will be logged which spams the logs
|
|
|
|
// error_log($domain . ' was accepted as valid domain.');
|
2023-08-10 12:36:39 +03:00
|
|
|
http_response_code(200);
|
|
|
|
}
|