diff options
author | Stephane Lapie <stephane.lapie@asahinet.com> | 2014-06-23 23:41:59 +0900 |
---|---|---|
committer | Stephane Lapie <stephane.lapie@asahinet.com> | 2014-06-23 23:41:59 +0900 |
commit | ec079fc18a1289be2676fa57c15829b20cb4a912 (patch) | |
tree | 658ebfeb07d9ead4fb5c8d86d723a94819d02511 /config/haproxy-stable | |
parent | ab69db91000fd3d83bf86811ede117062f57f438 (diff) | |
parent | 5b4c84c4ecc9a6eded4ce3443a665eae2c8a43f9 (diff) | |
download | pfsense-packages-ec079fc18a1289be2676fa57c15829b20cb4a912.tar.gz pfsense-packages-ec079fc18a1289be2676fa57c15829b20cb4a912.tar.bz2 pfsense-packages-ec079fc18a1289be2676fa57c15829b20cb4a912.zip |
Merge https://github.com/pfsense/pfsense-packages
Conflicts:
pkg_config.10.xml
pkg_config.8.xml
pkg_config.8.xml.amd64
Diffstat (limited to 'config/haproxy-stable')
-rwxr-xr-x | config/haproxy-stable/haproxy_global.php | 6 | ||||
-rwxr-xr-x | config/haproxy-stable/haproxy_listeners_edit.php | 12 | ||||
-rwxr-xr-x | config/haproxy-stable/haproxy_pool_edit.php | 6 |
3 files changed, 20 insertions, 4 deletions
diff --git a/config/haproxy-stable/haproxy_global.php b/config/haproxy-stable/haproxy_global.php index c8b05d52..47c8d1ec 100755 --- a/config/haproxy-stable/haproxy_global.php +++ b/config/haproxy-stable/haproxy_global.php @@ -56,7 +56,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-stable/haproxy_listeners_edit.php b/config/haproxy-stable/haproxy_listeners_edit.php index e9c6187c..3c698d4e 100755 --- a/config/haproxy-stable/haproxy_listeners_edit.php +++ b/config/haproxy-stable/haproxy_listeners_edit.php @@ -113,12 +113,20 @@ 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); + $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/config/haproxy-stable/haproxy_pool_edit.php b/config/haproxy-stable/haproxy_pool_edit.php index 1e9958eb..51eb4e28 100755 --- a/config/haproxy-stable/haproxy_pool_edit.php +++ b/config/haproxy-stable/haproxy_pool_edit.php @@ -72,7 +72,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."; |