aboutsummaryrefslogtreecommitdiffstats
path: root/config/varnish64/varnish.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-04-27 21:54:42 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-04-27 21:54:42 -0400
commitb3879db49f2473f56894aeb22eb5391a29489d34 (patch)
treef95557b246409153be79f6b1bedf3ffe4f9f14a4 /config/varnish64/varnish.inc
parentd998c5cf12d1bfa4da7b3e0c21555b230d989bca (diff)
downloadpfsense-packages-b3879db49f2473f56894aeb22eb5391a29489d34.tar.gz
pfsense-packages-b3879db49f2473f56894aeb22eb5391a29489d34.tar.bz2
pfsense-packages-b3879db49f2473f56894aeb22eb5391a29489d34.zip
Add input validation for the LB directors form
Diffstat (limited to 'config/varnish64/varnish.inc')
-rw-r--r--config/varnish64/varnish.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/config/varnish64/varnish.inc b/config/varnish64/varnish.inc
index 735152f7..295533b9 100644
--- a/config/varnish64/varnish.inc
+++ b/config/varnish64/varnish.inc
@@ -31,8 +31,15 @@
*/
/* ========================================================================== */
+function varnish_lb_directors_post_validate($post, $input_errors) {
+ if (preg_match("/[^a-zA-Z0-9]/", $post['directorname']))
+ $input_errors[] = "The directorname name must only contain the characters a-Z or 0-9";
+ if(stristr($post['directorurl'], 'http'))
+ $input_errors[] = "You do not need to include the http:// string in the director URL";
+}
+
function varnish_backends_post_validate($post, $input_errors) {
- if (preg_match("/[^a-zA-Z0-9\.\-_]/", $post['backendname']))
+ if (preg_match("/[^a-zA-Z0-9]/", $post['backendname']))
$input_errors[] = "The backend name must only contain the characters a-Z or 0-9";
if(!is_ipaddr($post['ipaddress']))
$input_errors[] = "A valid IP address is required for the field 'IPAddress'";