Next:
HTML::Balance
Previous:
conf::SiteConfig
 [Table of Contents]

HTML::AddNoFollow



NAME

HTML::AddNoFollow - A simple module to add 'rel="nofollow"' to hyperlinks.

SYNOPSIS

    #!/usr/bin/perl -w
    use HTML::AddNoFollow;
    use strict;

    my $html = q[ <a href="http://foo.com/">Test</a> ];

    my $cgi  = new CGI;
    $cgi->param( "html", $html );

    $cgi = HTML::AddNoFollow::sanitize( $cgi );

DESCRIPTION

If you wish to display user supplied HTML text you may well find that people submit links inside HTML, designed to increase their page-rank.

This module automatically defeats those people by adding the 'rel="nofollow"' to the hyperlinks.

The module will correctly modify all input which is accessed via a CGI object - if you wish to only filter one particular variable then you must create a fake CGI object, as shown in the example.

SOURCE

This code was achieved via a discussion on Perlmonks.org, via a question I submitted. For all the discussion please see the following URI:

http://www.perlmonks.org/?node_id=452790

sanitize_string

  Sanitize a single HTML String.

AUTHOR

Steve Kemp

http://www.steve.org.uk/

LICENSE

Copyright (c) 2005 by Steve Kemp. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The LICENSE file contains the full text of the license.


[Top] Generated by HTML::FromPod 0.49 on Fri Nov 21 03:03:57 2008