| 1 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 2 | # GX Framework (c) 2009-2011 Jörg A. Uzarek <uzarek@runlevelnull.de> | ||||||||||
| 3 | # File: GX/HTML/Util.pm | ||||||||||
| 4 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 5 | |||||||||||
| 6 | package GX::HTML::Util; | ||||||||||
| 7 | |||||||||||
| 8 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | |||||||||||
| 12 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 13 | # Export mechanism | ||||||||||
| 14 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 15 | |||||||||||
| 16 | 6 | ▶ | use base 'Exporter'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 6 | our @EXPORT_OK = qw( escape_html ); | |||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 22 | # Public functions | ||||||||||
| 23 | # ---------------------------------------------------------------------------------------------------------------------- | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub escape_html { | ||||||||
|
Subroutine
escape_html: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 26 | |||||||||||
| 27 | 0 | my $string = shift; | |||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | if ( defined $string ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | $string =~ s/&/&/g; | |||||||||
| 31 | 0 | $string =~ s/</</g; | |||||||||
| 32 | 0 | $string =~ s/>/>/g; | |||||||||
| 33 | 0 | $string =~ s/"/"/g; | |||||||||
| 34 | 0 | $string =~ s/'/'/g; | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 0 | return $string; | |||||||||
| 38 | |||||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | |||||||||||
| 42 | 6 | 1; | |||||||||
| 43 | |||||||||||
| 44 | __END__ | ||||||||||