From 7051ab51a12cc3b94adb987d99a04126dd67b3a7 Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 9 May 2014 14:53:41 -0400 Subject: Fix call-time pass-by-reference in haproxy --- config/haproxy/haproxy_global.php | 6 +++++- config/haproxy/haproxy_listeners_edit.php | 11 +++++++++-- config/haproxy/haproxy_pool_edit.php | 6 +++++- pkg_config.10.xml | 2 +- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/config/haproxy/haproxy_global.php b/config/haproxy/haproxy_global.php index 16f5152d..40b5cd90 100755 --- a/config/haproxy/haproxy_global.php +++ b/config/haproxy/haproxy_global.php @@ -59,7 +59,11 @@ if ($_POST) { if ($_POST['carpdev'] == "disabled") unset($_POST['carpdev']); - 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/haproxy_listeners_edit.php b/config/haproxy/haproxy_listeners_edit.php index 2b71c7ea..be45fd8b 100755 --- a/config/haproxy/haproxy_listeners_edit.php +++ b/config/haproxy/haproxy_listeners_edit.php @@ -113,12 +113,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/haproxy_pool_edit.php b/config/haproxy/haproxy_pool_edit.php index 4da508f2..6feab2ff 100755 --- a/config/haproxy/haproxy_pool_edit.php +++ b/config/haproxy/haproxy_pool_edit.php @@ -71,7 +71,11 @@ if ($_POST) { $reqdfields = explode(" ", "name"); $reqdfieldsn = explode(",", "Name"); - 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."; diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 68a584ef..1cf3d329 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -154,7 +154,7 @@ Supports acl's for smart backend switching.]]> http://haproxy.1wt.eu/ Services - 1.4.24_1 pkg v 1.2.4 + 1.4.24_1 pkg v 1.2.5 Release 2.2 https://packages.pfsense.org/packages/config/haproxy/haproxy.xml diff --git a/pkg_config.8.xml b/pkg_config.8.xml index f4521f58..172866ae 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -157,7 +157,7 @@ Supports acl's for smart backend switching.]]> http://haproxy.1wt.eu/ Services - 1.4.24 pkg v 1.2.4 + 1.4.24 pkg v 1.2.5 Release 2.0 https://packages.pfsense.org/packages/config/haproxy/haproxy.xml diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 10a26517..9dd5f799 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -144,7 +144,7 @@ Supports acl's for smart backend switching.]]> http://haproxy.1wt.eu/ Services - 1.4.24 pkg v 1.2.4 + 1.4.24 pkg v 1.2.5 Release 2.0 https://packages.pfsense.org/packages/config/haproxy/haproxy.xml -- cgit v1.2.3