From: Mike Taylor Date: Thu, 23 Aug 2007 14:29:18 +0000 (+0000) Subject: Validate hostname and port number of new records. X-Git-Tag: CPAN-v1.02~54^2~294 X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=0bed5b77c0f02b285b1edf5b11ce57459aa02740;ds=sidebyside Validate hostname and port number of new records. --- 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.