mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-28 06:20:14 +00:00
17
php/domain-validator.php
Normal file
17
php/domain-validator.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?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 {
|
||||
http_response_code(200);
|
||||
}
|
||||
Reference in New Issue
Block a user