Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37401039
en ru br
Репозитории ALT

Группа :: Разработка/Perl
Пакет: perl-HTML-TagFilter

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

#
#   - HTML::TagFilter -
#   This spec file was automatically generated by cpan2rpm [ver: 2.027]
#   (ALT Linux revision)
#   The following arguments were used:
#       HTML::TagFilter
#   For more information on cpan2rpm please visit: http://perl.arix.com/
#

%define module HTML-TagFilter
%define m_distro HTML-TagFilter
%define m_name HTML::TagFilter
%define m_author_id unknown
%define _enable_test 1

Name: perl-HTML-TagFilter
Version: 1.03
Release: alt1

Summary: A fine-grained html-filter, xss-blocker and mailto-obfuscator

License: Artistic
Group: Development/Perl
Url: http://www.cpan.org

Packager: Andrey V. Stroganov <dja at altlinux.org>

BuildArch: noarch
Source: %m_distro-%version.tar

# Automatically added by buildreq on Mon Jul 11 2011

# optimized out: perl-URI
BuildRequires: perl-HTML-Parser perl-devel

%description
HTML::TagFilter is a subclass of HTML::Parser with a single purpose:
it will remove unwanted html tags and attributes from a piece of text.
It can act in a more or less fine-grained way - you can specify
permitted tags, permitted attributes of each tag, and permitted
values for each attribute in as much detail as you like.

Tags which are not allowed are removed. Tags which are allowed are
trimmed down to only the attributes which are allowed for each tag.
It is possible to allow all or no attributes from a tag, or to allow
all or no values for an attribute, and so on.

The filter will also guard against cross-site scripting attacks
and obfuscate any mailto:email addresses, unless you tell it not to.

The original purpose for this was to screen user input.
In that setting you'll often find that just using:

   my $tf = new HTML::TagFilter;
   put_in_database($tf->filter($my_text));

will do. However, it can also be used for display processes
(eg text-only translation) or cleanup (eg removal of old javascript).
In those cases you'll probably want to override the default rule set
with a small number of denial rules.

   my $self = HTML::TagFilter->new(deny => {img => {'all'}});
   print $tf->filter($my_text);

Will strip out all images, for example, but leave everything
else untouched.

nb (faq #1) the filter only removes the tags themselves:
all it does to text which is not part of a tag is to escape
the <s and >s, to guard against false negatives and some common
cross-site attacks.

obPascal: Sorry about the incredibly long documentation, by the way.
When I have time I'll make it shorter.

%prep
%setup -n %m_distro-%version

%build
%perl_vendor_build

%install
%perl_vendor_install

%files
%perl_vendor_privlib/HTML/*

%changelog

Полный changelog можно просмотреть здесь

 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin