Skip to content

Commit fb67a58

Browse files
author
Till Brehm
committed
Implemented #4910 Do not permit to add subdomains of domain acme.invalid
1 parent e50909b commit fb67a58

File tree

61 files changed

+69
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+69
-0
lines changed

interface/lib/classes/validate_domain.inc.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ function web_domain($field_name, $field_value, $validator) {
5151

5252
$result = $this->_check_unique($field_value);
5353
if(!$result) return $this->get_error('domain_error_unique');
54+
55+
$pattern = '/\.acme\.invalid$/';
56+
if(preg_match($pattern, $field_value)) return $this->get_error('domain_error_acme_invalid');
5457
}
5558

5659
/* Validator function for sub domain */
@@ -65,6 +68,9 @@ function sub_domain($field_name, $field_value, $validator) {
6568

6669
$result = $this->_check_unique($field_value);
6770
if(!$result) return $this->get_error('domain_error_unique');
71+
72+
$pattern = '/\.acme\.invalid$/';
73+
if(preg_match($pattern, $field_value)) return $this->get_error('domain_error_acme_invalid');
6874
}
6975

7076
/* Validator function for alias domain */
@@ -77,6 +83,9 @@ function alias_domain($field_name, $field_value, $validator) {
7783

7884
$result = $this->_check_unique($field_value);
7985
if(!$result) return $this->get_error('domain_error_unique');
86+
87+
$pattern = '/\.acme\.invalid$/';
88+
if(preg_match($pattern, $field_value)) return $this->get_error('domain_error_acme_invalid');
8089
}
8190

8291
/* Validator function for checking the auto subdomain of a web/aliasdomain */

interface/web/sites/lib/lang/ar_web_aliasdomain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ $wb['apache_directives_txt'] = 'Apache Directives';
4343
$wb['domain_error_empty'] = 'Domain is empty.';
4444
$wb['domain_error_unique'] = 'There is already a website or sub / aliasdomain with this domain name.';
4545
$wb['domain_error_regex'] = 'Domain name invalid.';
46+
$wb['domain_error_acme_invalid'] = 'Domain name acme.invalid not permitted.';
4647
$wb['domain_error_autosub'] = 'There is already a subdomain with these settings.';
4748
$wb['hd_quota_error_empty'] = 'Harddisk quota is 0 or empty.';
4849
$wb['traffic_quota_error_empty'] = 'Traffic quota is empty.';

interface/web/sites/lib/lang/ar_web_aliasdomain_list.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ $wb['add_new_record_txt'] = 'Add new aliasdomain';
88
$wb['domain_error_empty'] = 'Domain is empty.';
99
$wb['domain_error_unique'] = 'Domain must be unique.';
1010
$wb['domain_error_regex'] = 'Domain name invalid.';
11+
$wb['domain_error_acme_invalid'] = 'Domain name acme.invalid not permitted.';
1112
$wb['no_redirect_txt'] = 'No redirect';
1213
$wb['no_flag_txt'] = 'No flag';
1314
$wb['none_txt'] = 'None';

interface/web/sites/lib/lang/ar_web_childdomain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ $wb['apache_directives_txt'] = 'Apache directives';
3535
$wb['domain_error_empty'] = 'Domain is empty.';
3636
$wb['domain_error_unique'] = 'There is already a website or sub / aliasdomain with this domain name.';
3737
$wb['domain_error_regex'] = 'Domain name invalid.';
38+
$wb['domain_error_acme_invalid'] = 'Domain name acme.invalid not permitted.';
3839
$wb['host_txt'] = 'Host';
3940
$wb['redirect_error_regex'] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
4041
$wb['no_redirect_txt'] = 'No redirect';

interface/web/sites/lib/lang/ar_web_childdomain_list.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ $wb['domain_txt'] = 'Subdomain';
77
$wb['domain_error_empty'] = 'Domain is empty.';
88
$wb['domain_error_unique'] = 'Domain must be unique.';
99
$wb['domain_error_regex'] = 'Domain name invalid.';
10+
$wb['domain_error_acme_invalid'] = 'Domain name acme.invalid not permitted.';
1011
$wb['no_redirect_txt'] = 'No redirect';
1112
$wb['no_flag_txt'] = 'No flag';
1213
$wb['none_txt'] = 'None';

interface/web/sites/lib/lang/ar_web_domain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ $wb['apache_directives_txt'] = 'Apache directives';
3838
$wb['domain_error_empty'] = 'Domain is empty.';
3939
$wb['domain_error_unique'] = 'There is already a website or sub / aliasdomain with this domain name.';
4040
$wb['domain_error_regex'] = 'Domain name invalid.';
41+
$wb['domain_error_acme_invalid'] = 'Domain name acme.invalid not permitted.';
4142
$wb['hd_quota_error_empty'] = 'Harddisk quota is 0 or empty.';
4243
$wb['traffic_quota_error_empty'] = 'Traffic quota is empty.';
4344
$wb['error_ssl_state_empty'] = 'SSL State is empty.';

interface/web/sites/lib/lang/ar_web_subdomain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ $wb['apache_directives_txt'] = 'Apache directives';
3535
$wb['domain_error_empty'] = 'Domain is empty.';
3636
$wb['domain_error_unique'] = 'There is already a website or sub / aliasdomain with this domain name.';
3737
$wb['domain_error_regex'] = 'Domain name invalid.';
38+
$wb['domain_error_acme_invalid'] = 'Domain name acme.invalid not permitted.';
3839
$wb['host_txt'] = 'Host';
3940
$wb['redirect_error_regex'] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
4041
$wb['no_redirect_txt'] = 'No redirect';

interface/web/sites/lib/lang/ar_web_vhost_domain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ $wb['apache_directives_txt'] = 'Apache directives';
3939
$wb['domain_error_empty'] = 'Domain is empty.';
4040
$wb['domain_error_unique'] = 'There is already a website or sub / aliasdomain with this domain name.';
4141
$wb['domain_error_regex'] = 'Domain name invalid.';
42+
$wb['domain_error_acme_invalid'] = 'Domain name acme.invalid not permitted.';
4243
$wb['hd_quota_error_empty'] = 'Harddisk quota is 0 or empty.';
4344
$wb['traffic_quota_error_empty'] = 'Traffic quota is empty.';
4445
$wb['error_ssl_state_empty'] = 'SSL State is empty.';

interface/web/sites/lib/lang/ar_web_vhost_subdomain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ $wb['apache_directives_txt'] = 'Apache Directives';
4747
$wb['domain_error_empty'] = 'Domain is empty.';
4848
$wb['domain_error_unique'] = 'There is already a website or sub / aliasdomain with this domain name.';
4949
$wb['domain_error_regex'] = 'Domain name invalid.';
50+
$wb['domain_error_acme_invalid'] = 'Domain name acme.invalid not permitted.';
5051
$wb['domain_error_wildcard'] = 'Wildcard subdomains are not allowed.';
5152
$wb['hd_quota_error_empty'] = 'Harddisk quota is 0 or empty.';
5253
$wb['traffic_quota_error_empty'] = 'Traffic quota is empty.';

interface/web/sites/lib/lang/bg_web_aliasdomain.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ $wb['apache_directives_txt'] = 'Apache Directives';
4343
$wb['domain_error_empty'] = 'Domain is empty.';
4444
$wb['domain_error_unique'] = 'There is already a website or sub / aliasdomain with this domain name.';
4545
$wb['domain_error_regex'] = 'Domain name invalid.';
46+
$wb['domain_error_acme_invalid'] = 'Domain name acme.invalid not permitted.';
4647
$wb['domain_error_autosub'] = 'There is already a subdomain with these settings.';
4748
$wb['hd_quota_error_empty'] = 'Harddisk quota is 0 or empty.';
4849
$wb['traffic_quota_error_empty'] = 'Traffic quota is empty.';

0 commit comments

Comments
 (0)