aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-06-20 15:50:54 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-06-20 15:50:54 -0300
commit5d02450ddf9b8628a7e4bc6052df7e6b76ff9502 (patch)
tree309c30410fdab4f434e0c9f395f5e810be988ffb
parentf72a1e651131846ca6494c78006a6c97267a6985 (diff)
downloadpfsense-packages-5d02450ddf9b8628a7e4bc6052df7e6b76ff9502.tar.gz
pfsense-packages-5d02450ddf9b8628a7e4bc6052df7e6b76ff9502.tar.bz2
pfsense-packages-5d02450ddf9b8628a7e4bc6052df7e6b76ff9502.zip
Fix call-time pass by reference for haproxy-devel package
-rw-r--r--config/haproxy-devel/haproxy_listeners_edit.php6
-rw-r--r--config/haproxy-devel/haproxy_pool_edit.php17
2 files changed, 19 insertions, 4 deletions
diff --git a/config/haproxy-devel/haproxy_listeners_edit.php b/config/haproxy-devel/haproxy_listeners_edit.php
index 6731731d..78423f6d 100644
--- a/config/haproxy-devel/haproxy_listeners_edit.php
+++ b/config/haproxy-devel/haproxy_listeners_edit.php
@@ -144,7 +144,11 @@ if ($_POST) {
$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/config/haproxy-devel/haproxy_pool_edit.php b/config/haproxy-devel/haproxy_pool_edit.php
index 49eb4271..cabc6e52 100644
--- a/config/haproxy-devel/haproxy_pool_edit.php
+++ b/config/haproxy-devel/haproxy_pool_edit.php
@@ -128,16 +128,27 @@ 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 ($_POST['stats_enabled']) {
$reqdfields = explode(" ", "name stats_uri");
$reqdfieldsn = explode(",", "Name,Stats Uri");
- 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 ($_POST['stats_username']) {
$reqdfields = explode(" ", "stats_password stats_realm");
$reqdfieldsn = explode(",", "Stats Password,Stats Realm");
- 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);
}
}