in reply to Very simple commenting system

Hi Zecho,
You can prevent both empty and whitespace names by matching one word character:

my $user = ( $q->param('user') =~ /\w/ ) ? $q->param('user') : "Anonym +ous";
but it would also be well to apply escapeHTML to $message and s/[^\x00-\x1f\x7f]//g for ($user,$message); as well. That will knock off unprintable nasties.

A minor point, you probably should use '<br/>' for xhtml correctness.

Update: changed break tag comment per blackmateria's reply, Thanks!

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Very simple commenting system
by blackmateria (Chaplain) on Nov 19, 2001 at 07:14 UTC
    Actually, he should use <br /> (in lowercase) for xhtml correctness. :)