WebEditor/OldFeatures/HTMLFilterHack.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 91.6% 22 / 24 CC 1 SCAR 1.5
CC
1
Cov
94%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« WE_Frontend/Main2.pm ↑ Summary WE/DB/NISUser.pm »
1 # -*- perl -*-
2  
3 #
4 # $Id: HTMLFilterHack.pm,v 1.1 2004/12/09 17:36:29 eserte Exp $
5 # Author: Slaven Rezic
6 #
7 # Copyright (C) 2004 Slaven Rezic. All rights reserved.
8 # This package is free software; you can redistribute it and/or
9 # modify it under the same terms as Perl itself.
10 #
11 # Mail: slaven@rezic.de
12 # WWW: http://www.rezic.de/eserte/
13 #
14  
15 package WebEditor::OldFeatures::HTMLFilterHack;
16  
17 =head1 NAME
18  
19 WebEditor::OldFeatures::HTMLFilterHack - replace the TT html filter
20  
21 =head1 SYNOPSIS
22  
23 In .../OldController.pm:
24  
25 use WebEditor::OldFeatures::HTMLFilterHack;
26  
27 In the templates:
28  
29 [% variable | html %]
30  
31 =head1 DESCRIPTION
32  
33 This is a untested hack to replace the standard "html" filter with a
34 version creating numeric entities.
35  
36 =cut
37  
38 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
39 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
40 1 $VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/);
41  
42 1 ▶use Template::Filters qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
43 1 ▶use HTML::Entities qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
44  
45 1 ▶no warnings 'redefine'; # XXX 5.005 compat missing
Subroutine BEGIN: called CC=1 SCAR=0.0
46  
47 0 ▶*Template::Filters::html_filter = sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
48 0 HTML::Entities::encode_entities_numeric($_[0]);
49 1 };
« WE_Frontend/Main2.pm ↑ Summary WE/DB/NISUser.pm »