diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2009-12-28 18:08:19 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2009-12-28 18:08:19 -0500 |
commit | 0e7223f625d8db9f7f2593fa88b97129b89e4d3a (patch) | |
tree | 07ba24c1bda2e23714d1e0e594fb734ea45f4d7b /config | |
parent | f97891b1d641ddc03837e776baaa347ff98837a7 (diff) | |
download | pfsense-packages-0e7223f625d8db9f7f2593fa88b97129b89e4d3a.tar.gz pfsense-packages-0e7223f625d8db9f7f2593fa88b97129b89e4d3a.tar.bz2 pfsense-packages-0e7223f625d8db9f7f2593fa88b97129b89e4d3a.zip |
Do not replace \n with spaces
Diffstat (limited to 'config')
-rw-r--r-- | config/haproxy/haproxy.inc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/config/haproxy/haproxy.inc b/config/haproxy/haproxy.inc index 7f57ae33..7102974c 100644 --- a/config/haproxy/haproxy.inc +++ b/config/haproxy/haproxy.inc @@ -109,7 +109,7 @@ function haproxy_configure() { if(is_array($a_global)) { fwrite ($fd, "global\n"); if($a_global['advanced']) - fwrite ($fd, "\t" . str_replace("\n", " ", base64deode($a_global['advanced'])) . "\n"); + fwrite ($fd, "\t" . base64deode($a_global['advanced']) . "\n"); fwrite ($fd, "\tmaxconn\t\t\t".$a_global['maxconn']."\n"); if($a_global['remotesyslog']) fwrite ($fd, "\tlog\t\t\t{$a_global['remotesyslog']}\n"); @@ -151,10 +151,12 @@ function haproxy_configure() { fwrite ($fd, "{$backendinfo}"); fwrite ($fd, "{$listenip}"); - // Advanced pass trhu - if($backend['advanced']) - fwrite ($fd, "\t" . str_replace("\n", " ", base64_decode($backend['advanced'])) . "\n"); - + // Advanced pass thru + if($backend['advanced']) { + $advanced = base64_decode($backend['advanced']); + fwrite($fd, "\t" . $advanced) . "\n"); + } + // https is an alias for tcp for clarity purpouses if(strtolower($backend['type']) == "https") { $backend_type = "tcp"; @@ -233,10 +235,12 @@ function haproxy_configure() { } else { $server_ports[] = $server['port']; } - if($server['advanced']) - $advanced_txt = " " . str_replace("\n", " ", base64_decode($server['advanced'])); - else + if($server['advanced']) { + $advanced = base64_decode($server['advanced']); + $advanced_txt = " " . $advanced; + } else { $advanced_txt = ""; + } foreach($server_ports as $pport) fwrite ($fd, "\tserver\t\t\t" . $server['name'] . " " . $server['address'].":" . $pport . " $cookie " . " check inter 1000 weight " . $server['weight'] . "{$advanced_txt}\n"); } |