diff options
author | jim-p <jimp@pfsense.org> | 2014-05-09 14:53:41 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2014-05-16 15:46:12 -0400 |
commit | 7051ab51a12cc3b94adb987d99a04126dd67b3a7 (patch) | |
tree | 29eb5601987f78c718e2e5783f514812137512ea /config/haproxy/haproxy_listeners_edit.php | |
parent | 1a20fc6d045ab53152605bbc34f1df2f64815e78 (diff) | |
download | pfsense-packages-7051ab51a12cc3b94adb987d99a04126dd67b3a7.tar.gz pfsense-packages-7051ab51a12cc3b94adb987d99a04126dd67b3a7.tar.bz2 pfsense-packages-7051ab51a12cc3b94adb987d99a04126dd67b3a7.zip |
Fix call-time pass-by-reference in haproxy
Diffstat (limited to 'config/haproxy/haproxy_listeners_edit.php')
-rwxr-xr-x | config/haproxy/haproxy_listeners_edit.php | 11 |
1 files changed, 9 insertions, 2 deletions
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."; |