Skip to content

Commit eb1177f

Browse files
author
Marius Cramer
committed
Merge branch 'master' into 'master'
Master See merge request !221
2 parents 8a77a74 + 2df8c0b commit eb1177f

32 files changed

+72
-38
lines changed

interface/lib/classes/functions.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ public function suggest_ips($type = 'IPv4'){
186186
global $app;
187187

188188
if($type == 'IPv4'){
189-
$regex = "/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/";
189+
// $regex = "/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/";
190+
$regex = "/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/";
190191
} else {
191192
// IPv6
192193
$regex = "/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i";

interface/lib/classes/tform_base.inc.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,11 +1058,10 @@ function validateField($field_name, $field_value, $validators) {
10581058
}
10591059
break;
10601060

1061-
1062-
10631061
case 'ISIPV4':
10641062
$vip=1;
1065-
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
1063+
// if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
1064+
if(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $field_value)){
10661065
$groups=explode(".", $field_value);
10671066
foreach($groups as $group){
10681067
if($group<0 or $group>255)
@@ -1078,6 +1077,7 @@ function validateField($field_name, $field_value, $validators) {
10781077
}
10791078
}
10801079
break;
1080+
10811081
case 'ISIP':
10821082
if($validator['allowempty'] != 'y') $validator['allowempty'] = 'n';
10831083
if($validator['allowempty'] == 'y' && $field_value == '') {
@@ -1107,7 +1107,8 @@ function validateField($field_name, $field_value, $validators) {
11071107
if(preg_match("/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i", $field_value)){
11081108
$ip_ok = 1;
11091109
}
1110-
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
1110+
// if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
1111+
if(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $field_value)){
11111112
$ip_ok = 1;
11121113
}
11131114
if($ip_ok == 0) {

interface/lib/classes/validate_database.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ function valid_ip_list($field_name, $field_value, $validator) {
4444
$cur_value = trim($cur_value);
4545

4646
$valid = true;
47-
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $cur_value)) {
47+
// if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $cur_value)) {
48+
if(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $cur_value)) {
4849
$groups = explode(".", $cur_value);
4950
foreach($groups as $group){
5051
if($group<0 or $group>255)

interface/lib/classes/validate_dns.inc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ function validate_xfer($field_name, $field_value, $validator) {
315315
if(preg_match("/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i", $field_value)){
316316
$ip_ok = 1;
317317
}
318-
if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
318+
// if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
319+
if(preg_match("/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/", $field_value)){
319320
$ip_ok = 1;
320321
}
321322
if($ip_ok == 0) {

interface/web/admin/form/server_ip_map.tform.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31-
$form["title"] = "IP Addresse mapping";
32-
$form["description"] = "";
31+
$form["title"] = "IPv4 Address mapping";
32+
$form["description"] = "Form to map IPv4-addresses for Web-Server";
3333
$form["name"] = "server_ip_map";
3434
$form["action"] = "server_ip_map_edit.php";
3535
$form["db_table"] = "server_ip_map";

interface/web/admin/lib/lang/ar_server_ip_map.lng

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
66
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
77
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
88
$wb["source_ip_empty"] = 'The Source IP is empty.';
9+
$wb["server_empty_error"] = 'The Server is empty.';
910
$wb["duplicate_mapping_error"] = "Mapping already exists.";
10-
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
11+
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
1112
?>

interface/web/admin/lib/lang/bg_server_ip_map.lng

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
66
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
77
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
88
$wb["source_ip_empty"] = 'The Source IP is empty.';
9+
$wb["server_empty_error"] = 'The Server is empty.';
910
$wb["duplicate_mapping_error"] = "Mapping already exists.";
10-
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
11+
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
1112
?>

interface/web/admin/lib/lang/br_server_ip_map.lng

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
66
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
77
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
88
$wb["source_ip_empty"] = 'The Source IP is empty.';
9+
$wb["server_empty_error"] = 'The Server is empty.';
910
$wb["duplicate_mapping_error"] = "Mapping already exists.";
10-
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
11+
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
1112
?>

interface/web/admin/lib/lang/cz_server_ip_map.lng

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Active';
66
$wb["ip_error_wrong"] = 'The Destination IP address is invalid';
77
$wb["destination_ip_empty"] = 'The Destination IP is empty.';
88
$wb["source_ip_empty"] = 'The Source IP is empty.';
9+
$wb["server_empty_error"] = 'The Server is empty.';
910
$wb["duplicate_mapping_error"] = "Mapping already exists.";
10-
$wb["duplicate_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
11+
$wb["ip_mapping_error"] = "Source IP can not be an IP of the Rewrite-Server";
1112
?>

interface/web/admin/lib/lang/de_server_ip_map.lng

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $wb["active_txt"] = 'Aktiv';
66
$wb["ip_error_wrong"] = 'Die neue IP ist ungueltig';
77
$wb["destination_ip_empty"] = 'Die neue IP ist leer.';
88
$wb["source_ip_empty"] = 'Die eigentliche IP ist leer.';
9+
$wb["server_empty_error"] = 'Der Server ist leer.';
910
$wb["duplicate_mapping_error"] = "Mapping existiert bereits.";
10-
$wb["duplicate_mapping_error"] = "Die eigentliche IP darf keine IP des Rewrite-Servers sein.";
11+
$wb["ip_mapping_error"] = "Die eigentliche IP darf keine IP des Rewrite-Servers sein.";
1112
?>

0 commit comments

Comments
 (0)