jk2addict,

Well, why not give us a short one to answer on Monday, hard ones are supposed to be for Friday aren't they?

It really depends on what you expect. Using HTML::Sanitize is handy when you have a form on a web site. I don't use it a lot because my validator tends to handle most of the stuff.

The heavy artillery in this battle is Data::FormValidator which comes with Data::FromValidator::Constraints and all of which can be teamed up with Regexp::Common. Validator has a series of filters already included, and you can add others, so you can write a validator/filter combaination for your descriptions that allows plain text with no HTML. But where it is somebodies sig file you might want to allow limited HTML styling.

Apart from the contraints and rules already created you can add your own using several different methods and even create complex rules that involve multiple fields or complex relationships. The ability to use cpan;//Regexp::Common is pretty darned amazing, but it is something I have never had need of yet, well, not yet! Maybe in a day or two looking at my to do list :)

jdtoronto


In reply to Re: Preferred Way of Scrubbing User Input Before DB Write by jdtoronto
in thread Preferred Way of Scrubbing User Input Before DB Write by jk2addict

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.