Codebase list libdata-formvalidator-perl / b980749
[svn-upgrade] Integrating new upstream version, libdata-formvalidator-perl (4.66) Jonathan Yu 14 years ago
8 changed file(s) with 51 addition(s) and 119 deletion(s). Raw diff Collapse all Expand all
0
1 4.66 Wed Feb 24 09:30:17 EST 2010
2
3 [DOCUMENTATION]
4 - Typo fixes (Jonathan Yu)
5
6 [INTERNALS]
7 - Test suite fix for 5.11.1 and newer.
8
09 4.65 Wed Dec 30 22:17:33 EST 2009
110
211 [NEW FEATURES]
00 Build.PL
11 Changes
2 MANIFEST This list of files
3 MANIFEST.SKIP
4 META.yml
5 README
6 RELEASE_NOTES
27 lib/Data/FormValidator.pm
38 lib/Data/FormValidator/Constraints.pm
49 lib/Data/FormValidator/Constraints/Dates.pm
611 lib/Data/FormValidator/ConstraintsFactory.pm
712 lib/Data/FormValidator/Filters.pm
813 lib/Data/FormValidator/Results.pm
9 MANIFEST This list of files
10 MANIFEST.SKIP
11 META.yml
12 README
13 RELEASE_NOTES
1414 t/00_base.t
1515 t/02_code_ref.t
1616 t/03_dependency.t
3232 t/27_qualify_ref_happy_death.t
3333 t/28_defaults_for_new.t
3434 t/30_filter_definedness.t
35 t/FV_length.t
36 t/ValidatorPackagesTest1.pm
37 t/ValidatorPackagesTest2.pm
3538 t/any_errors.t
3639 t/check_profile_syntax.t
3740 t/constraint_method.t
3841 t/constraint_method_string.t
39 t/constraint_method_zero.t
4042 t/constraint_regexp_map_profile_reuse.t
4143 t/constraints_builtin.t
4244 t/constraints_builtin_closure.t
5254 t/filter_constraints.t
5355 t/filters_builtin.t
5456 t/filters_shouldnt_modify.t
55 t/FV_length.t
5657 t/get_filtered_data.t
5758 t/get_input_data.t
5859 t/missing_optional.t
7576 t/upload_closure.t
7677 t/upload_mime_types.t
7778 t/upload_post_text.txt
78 t/ValidatorPackagesTest1.pm
79 t/ValidatorPackagesTest2.pm
8079 test/00_base.badformat
8180 test/00_base.profile
0 ---
1 abstract: "Validates user input (usually from an HTML form) based\non input profile."
0 --- #YAML:1.0
1 name: Data-FormValidator
2 version: 4.66
23 author:
3 - 'Mark Stosberg <mark@summersault.com>'
4 - Mark Stosberg <mark@summersault.com>
5 abstract: |-
6 Validates user input (usually from an HTML form) based
7 on input profile.
8 license: perl
9 requires:
10 Date::Calc: 5
11 Email::Valid: 0
12 File::MMagic: 1.17
13 Image::Size: 0
14 MIME::Types: 1.005
15 Perl6::Junction: 1.1
16 Regexp::Common: 0
17 Scalar::Util: 0
18 Test::More: 0
19 overload: 0
20 perl: 5.008
421 build_requires:
522 CGI: 3.48
6 configure_requires:
7 Module::Build: 0.36
8 generated_by: 'Module::Build version 0.3601'
9 license: perl
10 meta-spec:
11 url: http://module-build.sourceforge.net/META-spec-v1.4.html
12 version: 1.4
13 name: Data-FormValidator
1423 provides:
1524 Data::FormValidator:
1625 file: lib/Data/FormValidator.pm
17 version: 4.65
26 version: 4.66
1827 Data::FormValidator::Constraints:
1928 file: lib/Data/FormValidator/Constraints.pm
2029 version: 4.65
2332 version: 4.65
2433 Data::FormValidator::Constraints::RegexpCommon:
2534 file: lib/Data/FormValidator/Results.pm
35 version: 4.65
2636 Data::FormValidator::Constraints::Upload:
2737 file: lib/Data/FormValidator/Constraints/Upload.pm
2838 version: 4.65
3545 Data::FormValidator::Results:
3646 file: lib/Data/FormValidator/Results.pm
3747 version: 4.65
38 requires:
39 Date::Calc: 5
40 Email::Valid: 0
41 File::MMagic: 1.17
42 Image::Size: 0
43 MIME::Types: 1.005
44 Perl6::Junction: 1.1
45 Regexp::Common: 0
46 Scalar::Util: 0
47 Test::More: 0
48 overload: 0
49 perl: 5.008
50 resources:
51 license: http://dev.perl.org/licenses/
52 version: 4.65
48 generated_by: Module::Build version 0.2611
8181 unknowns
8282 This is a list of fields which are unknown to the profile. Whether
8383 or not this indicates an error in the user input is application
84 dependant.
84 dependent.
8585
8686 new()
8787 Using "new()" is only needed for advanced usage, including these cases:
700700 unknowns
701701 This is a list of fields which are unknown to the profile. Whether
702702 or not this indicates an error in the user input is application
703 dependant.
703 dependent.
704704
705705 constraints (profile key)
706706 This is a supported but deprecated profile key. Using
3232
3333 use vars qw( $VERSION $AUTOLOAD @ISA @EXPORT_OK %EXPORT_TAGS );
3434
35 $VERSION = '4.65';
35 $VERSION = '4.66';
3636
3737 require Exporter;
3838 @ISA = qw(Exporter);
223223
224224 This is a list of fields which are unknown to the profile. Whether or
225225 not this indicates an error in the user input is application
226 dependant.
226 dependent.
227227
228228 =back
229229
10861086
10871087 This is a list of fields which are unknown to the profile. Whether or
10881088 not this indicates an error in the user input is application
1089 dependant.
1089 dependent.
10901090
10911091 =back
10921092
+0
-73
t/constraint_method_zero.t less more
0 #!perl
1 # For RT#45177
2
3 use strict;
4 use warnings;
5
6 use Test::More 'no_plan';
7 use Data::FormValidator;
8
9 {
10 my $results = Data::FormValidator->check({ nine_is_ok => 9 }, {
11 required => [ 'nine_is_ok' ],
12 constraint_methods => { 'nine_is_ok' => qr/^(9)$/ },
13 untaint_all_constraints => 1,
14 });
15 is($results->valid('nine_is_ok'),9, "nine should be valid for 9 with capturing parens (untainted)");
16 }
17 {
18 my $results = Data::FormValidator->check({ nine_is_ok => 9 }, {
19 required => [ 'nine_is_ok' ],
20 constraint_methods => { 'nine_is_ok' => qr/^9$/ },
21 untaint_all_constraints => 1,
22 });
23 is($results->valid('nine_is_ok'),9, "nine should be valid for 9 without capturing parens (untainted)");
24 }
25 {
26 my $results = Data::FormValidator->check({ zero_is_ok => 0 }, {
27 required => [ 'zero_is_ok' ],
28 constraint_methods => { 'zero_is_ok' => qr/^0$/ },
29 untaint_all_constraints => 1,
30 });
31 is($results->valid('zero_is_ok'),0, "zero should be valid without capturing parens (untainted)");
32 }
33 {
34 my $results = Data::FormValidator->check({ zero_is_ok => 0 }, {
35 required => [ 'zero_is_ok' ],
36 constraint_methods => { 'zero_is_ok' => qr/^(0)$/ },
37 untaint_all_constraints => 1,
38 });
39 is($results->valid('zero_is_ok'),0, "zero should be valid with capturing parens (untainted)");
40 }
41 {
42 my $results = Data::FormValidator->check({ nine_is_ok => 9 }, {
43 required => [ 'nine_is_ok' ],
44 constraint_methods => { 'nine_is_ok' => qr/^(9)$/ },
45 });
46 is($results->valid('nine_is_ok'),9, "nine should be valid for 9 with capturing parens");
47 }
48 {
49 my $results = Data::FormValidator->check({ nine_is_ok => 9 }, {
50 required => [ 'nine_is_ok' ],
51 constraint_methods => { 'nine_is_ok' => qr/^9$/ },
52 });
53 is($results->valid('nine_is_ok'),9, "nine should be valid for 9 without capturing parens");
54 }
55 {
56 my $results = Data::FormValidator->check({ zero_is_ok => 0 }, {
57 required => [ 'zero_is_ok' ],
58 constraint_methods => { 'zero_is_ok' => qr/^0$/ },
59 });
60 is($results->valid('zero_is_ok'),0, "zero should be valid without capturing parens");
61 }
62 {
63 my $results = Data::FormValidator->check({ zero_is_ok => 0 }, {
64 required => [ 'zero_is_ok' ],
65 constraint_methods => { 'zero_is_ok' => qr/^(0)$/ },
66 });
67 is($results->valid('zero_is_ok'),0, "zero should be valid with capturing parens");
68 }
69
70
71
72
0 use Test::More tests => 4;
0 use Test::More 'no_plan';
11
2 BEGIN: {
3 use_ok('Data::FormValidator');
4 use_ok('Data::FormValidator::ConstraintsFactory',qw(&make_length_constraint));
5 }
2 use Data::FormValidator;
3 use Data::FormValidator::ConstraintsFactory 'make_length_constraint';
64
75 {
86 my $results = Data::FormValidator->check(
1212 my $replacer = FV_replace(qr/^a/,'b');
1313 is( $replacer->('aa'), 'ba', 'FV_replace positive test');
1414 is( $replacer->('XX'), 'XX', 'FV_replace negative test');
15
16 my $replacer = FV_replace(qr/^a/i,'b');
17 is( $replacer->('AA'), 'bA', 'FV_replace positive test');
1518 }
1619
1720