mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-11-15 19:44:31 +08:00
1cce2e535f
Signed-off-by: Simon L <szaimen@e.mail.de>
19 lines
675 B
PHP
19 lines
675 B
PHP
<?php
|
|
|
|
$domain = $_GET['domain'] ?? '';
|
|
|
|
if (strpos($domain, '.') === false) {
|
|
http_response_code(400);
|
|
} elseif (strpos($domain, '/') !== false) {
|
|
http_response_code(400);
|
|
} elseif (strpos($domain, ':') !== false) {
|
|
http_response_code(400);
|
|
} elseif (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {
|
|
http_response_code(400);
|
|
} elseif (filter_var($domain, FILTER_VALIDATE_IP)) {
|
|
http_response_code(400);
|
|
} else {
|
|
// Commented because logging is disabled as otherwise all attempts will be logged which spams the logs
|
|
// error_log($domain . ' was accepted as valid domain.');
|
|
http_response_code(200);
|
|
}
|