mirror of
https://github.com/nextcloud/all-in-one.git
synced 2024-12-27 09:10:58 +08:00
1b1626fe56
Signed-off-by: Simon L <szaimen@e.mail.de>
18 lines
556 B
PHP
18 lines
556 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)) {
|
|
http_response_code(400);
|
|
} elseif (filter_var($domain, FILTER_VALIDATE_IP)) {
|
|
http_response_code(400);
|
|
} else {
|
|
error_log($domain . ' was accepted as valid domain.');
|
|
http_response_code(200);
|
|
}
|