File: printable.pm

package info (click to toggle)
libcgi-untaint-perl 1.26-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 132 kB
  • sloc: perl: 302; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 603 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package CGI::Untaint::printable;

use strict;
use base 'CGI::Untaint::object';

sub _untaint_re {
	qr/^([\040-\377\r\n\t]*)$/;
}

=head1 NAME

CGI::Untaint::printable - validate as a printable value

=head1 SYNOPSIS

  my $name = $handler->extract(-as_printable => 'name');

=head1 DESCRIPTION

This Input Handler verifies that it is dealing with an 'printable'
string i.e. characters in the range \040-\377 (plus \r and \n).

The empty string is taken to be printable.

This is occasionally a useful 'fallback' pattern, but in general you
will want to write your own patterns to be stricter.

=cut

1;