From 37adca57db41b835b80d8e9eea5545dd6cb694b1 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Mon, 9 Dec 2013 18:15:18 -0200 Subject: varnish3 - fix save lb_director save error on pfsense 2.1 --- config/varnish3/varnish.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'config/varnish3/varnish.inc') diff --git a/config/varnish3/varnish.inc b/config/varnish3/varnish.inc index 983804c9..1895d214 100644 --- a/config/varnish3/varnish.inc +++ b/config/varnish3/varnish.inc @@ -65,8 +65,13 @@ function varnish_settings_post_validate($post, $input_errors) { } function varnish_lb_directors_post_validate($post, $input_errors) { - if (preg_match("/[^a-zA-Z0-9]/", $post['directorname'])) + if (preg_match("/[^a-zA-Z0-9]/", $post['directorname'])){ $input_errors[] = "The directorname name must only contain the characters a-Z or 0-9"; + } + else{ + if(empty($post['failover'])) + $_POST['failover'] = $post['directorname']; + } if(stristr($post['directorurl'], 'http')) $input_errors[] = "You do not need to include the http:// string in the director URL"; if($post['grace'] && ! preg_match("/^\d+(h|m|s)$/",$post['grace'])) -- cgit v1.2.3