R
Robert
Hello,
I am trying to secure my mailer script from those who might try to hijack it
by adding "To:" etc fields in the form fields.
Currently I am using this:
my $name = param('name');
if ($name =~ /To:/) { &spamattempt; }
if ($name =~ /to:/) { &spamattempt; }
Basically if the "name" fields contains either an upper or lower case To or
to the script will direct to a subroutine where the process is terminated.
This all works fine. My Question ... is there an easier way to write the
regex above that looks for To:/to: etc? I was thinking maybe it could be
done with a single regex where is searches for either an upper or lower case
T or O followed by a : I did some research on regex case sensitivity and
found that the "i" operator is needed but couldn't make it work. Thanx all
in advance.
Robert
I am trying to secure my mailer script from those who might try to hijack it
by adding "To:" etc fields in the form fields.
Currently I am using this:
my $name = param('name');
if ($name =~ /To:/) { &spamattempt; }
if ($name =~ /to:/) { &spamattempt; }
Basically if the "name" fields contains either an upper or lower case To or
to the script will direct to a subroutine where the process is terminated.
This all works fine. My Question ... is there an easier way to write the
regex above that looks for To:/to: etc? I was thinking maybe it could be
done with a single regex where is searches for either an upper or lower case
T or O followed by a : I did some research on regex case sensitivity and
found that the "i" operator is needed but couldn't make it work. Thanx all
in advance.
Robert