aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-legacy/haproxy_frontends_edit.php
diff options
context:
space:
mode:
Diffstat (limited to 'config/haproxy-legacy/haproxy_frontends_edit.php')
-rwxr-xr-xconfig/haproxy-legacy/haproxy_frontends_edit.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/config/haproxy-legacy/haproxy_frontends_edit.php b/config/haproxy-legacy/haproxy_frontends_edit.php
index db1c71be..b32cb762 100755
--- a/config/haproxy-legacy/haproxy_frontends_edit.php
+++ b/config/haproxy-legacy/haproxy_frontends_edit.php
@@ -96,12 +96,19 @@ if ($_POST) {
$reqdfieldsn = explode(",", "Name,Connection timeout,Server timeout");
}
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+ $pf_version=substr(trim(file_get_contents("/etc/version")),0,3);
+ if ($pf_version < 2.1)
+ $input_errors = eval('do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); return $input_errors;');
+ else
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
$reqdfields = explode(" ", "name type port max_connections client_timeout");
$reqdfieldsn = explode(",", "Name,Type,Port,Max connections,Client timeout");
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
+ if ($pf_version < 2.1)
+ $input_errors = eval('do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); return $input_errors;');
+ else
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['name']))
$input_errors[] = "The field 'Name' contains invalid characters.";