From 0fea430100e63268f0dc313061a713fe114c7c59 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 10 Apr 2014 16:31:57 -0400 Subject: Fix a whole bunch of invalid version tests. --- config/haproxy-stable/haproxy_global.php | 4 ++-- config/haproxy-stable/haproxy_listeners.php | 4 ++-- config/haproxy-stable/haproxy_listeners_edit.php | 4 ++-- config/haproxy-stable/haproxy_pool_edit.php | 4 ++-- config/haproxy-stable/haproxy_pools.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'config/haproxy-stable') diff --git a/config/haproxy-stable/haproxy_global.php b/config/haproxy-stable/haproxy_global.php index fa58f9a2..c8b05d52 100755 --- a/config/haproxy-stable/haproxy_global.php +++ b/config/haproxy-stable/haproxy_global.php @@ -107,8 +107,8 @@ if (!$pconfig['logfacility']) if (!$pconfig['loglevel']) $pconfig['loglevel'] = 'info'; -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Settings"; diff --git a/config/haproxy-stable/haproxy_listeners.php b/config/haproxy-stable/haproxy_listeners.php index b34b2590..8c6125f0 100755 --- a/config/haproxy-stable/haproxy_listeners.php +++ b/config/haproxy-stable/haproxy_listeners.php @@ -65,8 +65,8 @@ if ($_GET['act'] == "del") { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Listener"; diff --git a/config/haproxy-stable/haproxy_listeners_edit.php b/config/haproxy-stable/haproxy_listeners_edit.php index f2b244df..e9c6187c 100755 --- a/config/haproxy-stable/haproxy_listeners_edit.php +++ b/config/haproxy-stable/haproxy_listeners_edit.php @@ -241,8 +241,8 @@ if ($_POST) { } } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "HAProxy: Listener: Edit"; diff --git a/config/haproxy-stable/haproxy_pool_edit.php b/config/haproxy-stable/haproxy_pool_edit.php index 6ca730e9..1e9958eb 100755 --- a/config/haproxy-stable/haproxy_pool_edit.php +++ b/config/haproxy-stable/haproxy_pool_edit.php @@ -173,8 +173,8 @@ if ($_POST) { $pconfig['a_servers']=&$a_pools[$id]['ha_servers']['item']; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "HAProxy: pool: Edit"; diff --git a/config/haproxy-stable/haproxy_pools.php b/config/haproxy-stable/haproxy_pools.php index c3bc30b1..0edc2ad8 100755 --- a/config/haproxy-stable/haproxy_pools.php +++ b/config/haproxy-stable/haproxy_pools.php @@ -67,8 +67,8 @@ if ($_GET['act'] == "del") { exit; } -$pfSversion = str_replace("\n", "", file_get_contents("/etc/version")); -if(strstr($pfSversion, "1.2")) +$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); +if ($pf_version < 2.0) $one_two = true; $pgtitle = "Services: HAProxy: Server pools"; -- cgit v1.2.3