From 0807cc79ae72ca49352a6f1e4d1f0e4cab46fb5b Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Thu, 23 Aug 2007 14:29:18 +0000 Subject: [PATCH] Validate hostname and port number of new records. --- web/htdocs/details/edit.mc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/htdocs/details/edit.mc b/web/htdocs/details/edit.mc index e435624..95686a1 100644 --- a/web/htdocs/details/edit.mc +++ b/web/htdocs/details/edit.mc @@ -1,4 +1,4 @@ -%# $Id: edit.mc,v 1.36 2007-07-17 13:04:45 mike Exp $ +%# $Id: edit.mc,v 1.37 2007-08-23 14:29:18 mike Exp $ <%args> $op $id => undef ### should be extracted using utf8param() @@ -68,6 +68,14 @@ if (!defined $id) { print qq[

Please specify protocol, host, port and database name.

\n]; undef $update; + } elsif ($host !~ /^\w+\.[\w.]*\w$/i) { + print qq[

+ This host name is not valid.

\n]; + undef $update; + } elsif ($port !~ /^\d*$/i) { + print qq[

+ This port number is not valid.

\n]; + undef $update; } else { # Creating new record, all necessary data is present. Check # that the new record is not a duplicate of an existing one. -- 1.7.10.4