Skip to content

Commit 61c7726

Browse files
committed
Fixed: FS#1083 - Make some validation for Redirect paths.
1 parent fd7b50a commit 61c7726

File tree

5 files changed

+52
-38
lines changed

5 files changed

+52
-38
lines changed

interface/web/sites/form/web_aliasdomain.tform.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@
111111
'redirect_path' => array (
112112
'datatype' => 'VARCHAR',
113113
'formtype' => 'TEXT',
114+
'validators' => array ( 0 => array ( 'type' => 'REGEX',
115+
'regex' => '@^(([.]{0})|(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)|(/[\w/_\.\-]{1,255}/))$@',
116+
'errmsg'=> 'redirect_error_regex'),
117+
),
114118
'default' => '',
115119
'value' => '',
116120
'width' => '30',

interface/web/sites/form/web_domain.tform.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@
223223
),
224224
'redirect_path' => array (
225225
'datatype' => 'VARCHAR',
226+
'validators' => array ( 0 => array ( 'type' => 'REGEX',
227+
'regex' => '@^(([.]{0})|(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)|(/[\w/_\.\-]{1,255}/))$@',
228+
'errmsg'=> 'redirect_error_regex'),
229+
),
226230
'formtype' => 'TEXT',
227231
'default' => '',
228232
'value' => '',

interface/web/sites/form/web_subdomain.tform.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@
111111
'redirect_path' => array (
112112
'datatype' => 'VARCHAR',
113113
'formtype' => 'TEXT',
114+
'validators' => array ( 0 => array ( 'type' => 'REGEX',
115+
'regex' => '@^(([.]{0})|(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.]*(\?\S+)?)?)?)|(/[\w/_\.\-]{1,255}/))$@',
116+
'errmsg'=> 'redirect_error_regex'),
117+
),
114118
'default' => '',
115119
'value' => '',
116120
'width' => '30',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,5 @@ $wb["ssl_organisation_error_regex"] = 'Invalid SSL Organisation. Valid character
5555
$wb["ssl_organistaion_unit_error_regex"] = 'Invalid SSL Organisation Unit. Valid characters are: a-z, 0-9 and .,-_';
5656
$wb["ssl_country_error_regex"] = 'Invalid SSL Country. Valid characters are: A-Z';
5757
$wb["limit_traffic_quota_free_txt"] = 'Max. available Traffic Quota';
58+
$wb["redirect_error_regex"] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
5859
?>
Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,40 @@
1-
<?php
2-
$wb["ssl_state_txt"] = 'State';
3-
$wb["ssl_locality_txt"] = 'Locality';
4-
$wb["ssl_organisation_txt"] = 'Organisation';
5-
$wb["ssl_organisation_unit_txt"] = 'Organisation Unit';
6-
$wb["ssl_country_txt"] = 'Country';
7-
$wb["ssl_request_txt"] = 'SSL Request';
8-
$wb["ssl_cert_txt"] = 'SSL Certificate';
9-
$wb["ssl_bundle_txt"] = 'SSL Bundle';
10-
$wb["ssl_action_txt"] = 'SSL Action';
11-
$wb["server_id_txt"] = 'Server';
12-
$wb["domain_txt"] = 'Domain';
13-
$wb["type_txt"] = 'Type';
14-
$wb["parent_domain_id_txt"] = 'Parent Website';
15-
$wb["redirect_type_txt"] = 'Redirect Type';
16-
$wb["redirect_path_txt"] = 'Redirect Path';
17-
$wb["active_txt"] = 'Active';
18-
$wb["document_root_txt"] = 'Documentroot';
19-
$wb["system_user_txt"] = 'Linux User';
20-
$wb["system_group_txt"] = 'Linux Group';
21-
$wb["ip_address_txt"] = 'IP-Address';
22-
$wb["vhost_type_txt"] = 'VHost Type';
23-
$wb["hd_quota_txt"] = 'Harddisk Quota';
24-
$wb["traffic_quota_txt"] = 'Traffic Quaota';
25-
$wb["cgi_txt"] = 'CGI';
26-
$wb["ssi_txt"] = 'SSI';
27-
$wb["ssl_txt"] = 'SSL';
28-
$wb["suexec_txt"] = 'SuEXEC';
29-
$wb["php_txt"] = 'PHP';
30-
$wb["client_txt"] = 'Client';
31-
$wb["limit_web_domain_txt"] = 'The max. number of web domains for your account is reached.';
32-
$wb["limit_web_aliasdomain_txt"] = 'The max. number of aliasdomains for your account is reached.';
33-
$wb["limit_web_subdomain_txt"] = 'The max. number of web subdomains for your account is reached.';
34-
$wb["apache_directives_txt"] = 'Apache directives';
35-
$wb["domain_error_empty"] = 'Domain is empty.';
36-
$wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.';
37-
$wb["domain_error_regex"] = 'Domain name invalid.';
38-
$wb["host_txt"] = 'Host';
1+
<?php
2+
$wb["ssl_state_txt"] = 'State';
3+
$wb["ssl_locality_txt"] = 'Locality';
4+
$wb["ssl_organisation_txt"] = 'Organisation';
5+
$wb["ssl_organisation_unit_txt"] = 'Organisation Unit';
6+
$wb["ssl_country_txt"] = 'Country';
7+
$wb["ssl_request_txt"] = 'SSL Request';
8+
$wb["ssl_cert_txt"] = 'SSL Certificate';
9+
$wb["ssl_bundle_txt"] = 'SSL Bundle';
10+
$wb["ssl_action_txt"] = 'SSL Action';
11+
$wb["server_id_txt"] = 'Server';
12+
$wb["domain_txt"] = 'Domain';
13+
$wb["type_txt"] = 'Type';
14+
$wb["parent_domain_id_txt"] = 'Parent Website';
15+
$wb["redirect_type_txt"] = 'Redirect Type';
16+
$wb["redirect_path_txt"] = 'Redirect Path';
17+
$wb["active_txt"] = 'Active';
18+
$wb["document_root_txt"] = 'Documentroot';
19+
$wb["system_user_txt"] = 'Linux User';
20+
$wb["system_group_txt"] = 'Linux Group';
21+
$wb["ip_address_txt"] = 'IP-Address';
22+
$wb["vhost_type_txt"] = 'VHost Type';
23+
$wb["hd_quota_txt"] = 'Harddisk Quota';
24+
$wb["traffic_quota_txt"] = 'Traffic Quaota';
25+
$wb["cgi_txt"] = 'CGI';
26+
$wb["ssi_txt"] = 'SSI';
27+
$wb["ssl_txt"] = 'SSL';
28+
$wb["suexec_txt"] = 'SuEXEC';
29+
$wb["php_txt"] = 'PHP';
30+
$wb["client_txt"] = 'Client';
31+
$wb["limit_web_domain_txt"] = 'The max. number of web domains for your account is reached.';
32+
$wb["limit_web_aliasdomain_txt"] = 'The max. number of aliasdomains for your account is reached.';
33+
$wb["limit_web_subdomain_txt"] = 'The max. number of web subdomains for your account is reached.';
34+
$wb["apache_directives_txt"] = 'Apache directives';
35+
$wb["domain_error_empty"] = 'Domain is empty.';
36+
$wb["domain_error_unique"] = 'There is already a website or sub / aliasdomain with this domain name.';
37+
$wb["domain_error_regex"] = 'Domain name invalid.';
38+
$wb["host_txt"] = 'Host';
39+
$wb["redirect_error_regex"] = 'Invalid redirect path. Valid redirects are for example: /test/ or http://www.domain.tld/test/';
3940
?>

0 commit comments

Comments
 (0)