mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-05-31 16:00:09 +00:00
domain-validator: use str_contains instead of strpos
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
|
||||
$domain = $_GET['domain'] ?? '';
|
||||
|
||||
if (strpos($domain, '.') === false) {
|
||||
if (!str_contains($domain, '.')) {
|
||||
http_response_code(400);
|
||||
} elseif (strpos($domain, '/') !== false) {
|
||||
} elseif (str_contains($domain, '/')) {
|
||||
http_response_code(400);
|
||||
} elseif (strpos($domain, ':') !== false) {
|
||||
} elseif (str_contains($domain, ':')) {
|
||||
http_response_code(400);
|
||||
} elseif (filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false) {
|
||||
http_response_code(400);
|
||||
|
||||
Reference in New Issue
Block a user