RST improvements

This commit is contained in:
Pinga 2025-05-05 15:37:12 +03:00
parent d755704917
commit 6528ad6530
4 changed files with 86 additions and 141 deletions

View file

@ -268,8 +268,11 @@ function validate_label($domain, $db) {
}
} else {
// Prevent consecutive or invalid hyphen usage
if (preg_match('/--|\.\./', $label)) {
return 'Domain labels cannot contain consecutive dashes (--) or dots (..)';
if ($label !== $labels[0] && preg_match('/\.\./', $label)) {
return 'Domain labels cannot contain consecutive dots (..)';
}
if (preg_match('/^..--/', $label)) {
return 'Domain labels cannot have double hyphens at position 3 and 4';
}
}
}