mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-19 22:16:49 +00:00
domain-validator: use str_contains instead of strpos
Signed-off-by: Simon L. <szaimen@e.mail.de>
This commit is contained in:
parent
5dfe0b755a
commit
40306c4ed3
2 changed files with 6 additions and 6 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue