aboutsummaryrefslogtreecommitdiffstats
path: root/config/haproxy-legacy
diff options
context:
space:
mode:
authorMartin Fuchs <trendchiller@users.noreply.github.com>2014-06-10 15:48:33 +0200
committerMartin Fuchs <trendchiller@users.noreply.github.com>2014-06-10 15:48:33 +0200
commit0ef20f92b5bea3d3487c249d515f905d09f859a7 (patch)
tree76101c20efe2f68b0f455070f1f077058e52868d /config/haproxy-legacy
parentff5060af8732ef9bd55a95537f3705c7382e19e0 (diff)
parentb2bea6eac166ab17ed1e5776ea32d822f459a914 (diff)
downloadpfsense-packages-0ef20f92b5bea3d3487c249d515f905d09f859a7.tar.gz
pfsense-packages-0ef20f92b5bea3d3487c249d515f905d09f859a7.tar.bz2
pfsense-packages-0ef20f92b5bea3d3487c249d515f905d09f859a7.zip
Merge pull request #1 from pfsense/master
update fork
Diffstat (limited to 'config/haproxy-legacy')
-rwxr-xr-xconfig/haproxy-legacy/haproxy_frontends_edit.php11
-rwxr-xr-xconfig/haproxy-legacy/haproxy_global.php6
-rwxr-xr-xconfig/haproxy-legacy/haproxy_servers_edit.php6
3 files changed, 19 insertions, 4 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.";
diff --git a/config/haproxy-legacy/haproxy_global.php b/config/haproxy-legacy/haproxy_global.php
index 509fdfe2..4ea03c75 100755
--- a/config/haproxy-legacy/haproxy_global.php
+++ b/config/haproxy-legacy/haproxy_global.php
@@ -57,7 +57,11 @@ if ($_POST) {
$reqdfieldsn = explode(",", "Maximum connections");
}
- 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);
if ($_POST['maxconn'] && (!is_numeric($_POST['maxconn'])))
$input_errors[] = "The maximum number of connections should be numeric.";
diff --git a/config/haproxy-legacy/haproxy_servers_edit.php b/config/haproxy-legacy/haproxy_servers_edit.php
index 86431992..843ecca5 100755
--- a/config/haproxy-legacy/haproxy_servers_edit.php
+++ b/config/haproxy-legacy/haproxy_servers_edit.php
@@ -70,7 +70,11 @@ if ($_POST) {
$reqdfields = explode(" ", "name address weight");
$reqdfieldsn = explode(",", "Name,Address,Weight");
- 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);
if (preg_match("/[^a-zA-Z0-9\.\-_]/", $_POST['name']))
$input_errors[] = "The field 'Name' contains invalid characters.";