Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67a
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    HTML::CGIChecker 0.90

    Download button

    No screenshots available
    Downloads: 335  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Fair (2.0/5)
    1 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Tomas Styblo | More programs
    Perl Artistic License / FREE
    August 7th, 2007, 10:05 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    HTML::CGIChecker description

    A Perl module to detect dangerous HTML code

    HTML::CGIChecker is a Perl module to detect dangerous HTML code.

    SYNOPSIS

    use HTML::CGIChecker;

    $feedback = '
    < TABLE CELLPADDING="2" >< TR >< TD >One column< /TD >< /TR >< /TABLE >< BR >
    " Arrays & variables "


    Dough > Hi, how are you ?

    And now some Perl code:
    < PRE >
    print "< HTML >< BODY >< /BODY >< /HTML >";
    < /PRE >
    ';

    # create the $checker object

    $checker = new HTML::CGIChecker (
    mode => 'allow',
    allowclasses => [ qw( tables images ) ],
    allowtags => [ qw ( B I A U STRONG BR HR ) ],
    jscript => 0,
    html => 0,
    pre => 1,
    debug => 0,
    err_tag => 'Tag {tag} is not allowed in {element}.'
    );

    # Now you can use it to check any string using its checkHTML()
    # method. It "remembers" its configuration, so you can reuse it.

    ($checked_feedback, $Warnings) =
    $checker->checkHTML ($feedback);

    # Process the results ...

    if ($checked_feedback) {
    # save $checked_feedback to the database ....
    }
    else {
    # print the warnings ...
    print join ("n", @{$Warnings});
    }

    The example above produces no warning messages and returns $feedback checked and properly HTML escaped. The only HTML "error" - the unescaped ">" bracket on the fourth line - is autocorrected. One warning message was overriden by a customized version. Potential warnings would not be HTML formatted and HTML safe, because the 'html' parameter is not true.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    CGI checker | HTML code checker | Perl module | check | CGI | HTML

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM