Subject: | [patch] documentation typos |
Attached is a patch for some minor typos in the documentation and code
comments.
Thanks for your continued work on this module.
-E
Subject: | dfv.doco.patch |
diff -Naur Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Constraints/Dates.pm Data-FormValidator-4.49_1/lib/Data/FormValidator/Constraints/Dates.pm
--- Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Constraints/Dates.pm 2006-10-03 14:14:46.000000000 -0400
+++ Data-FormValidator-4.49_1/lib/Data/FormValidator/Constraints/Dates.pm 2006-10-25 01:43:56.390684656 -0400
@@ -148,7 +148,7 @@
p AM|PM
Other parts of the string become part of the regular expression, so you can
-do perlish things like this to create mor complex expressions:
+do perlish things like this to create more complex expressions:
'MM?/DD?/YYYY|YYYY-MM?-DD?'
diff -Naur Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Constraints/Upload.pm Data-FormValidator-4.49_1/lib/Data/FormValidator/Constraints/Upload.pm
--- Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Constraints/Upload.pm 2006-10-03 14:14:46.000000000 -0400
+++ Data-FormValidator-4.49_1/lib/Data/FormValidator/Constraints/Upload.pm 2006-10-25 01:45:57.076337648 -0400
@@ -289,7 +289,7 @@
my $q = $self->get_input_data;
my $field = $self->get_current_constraint_field;
- ## CGI::Simple object processing (slighly different from others)
+ ## CGI::Simple object processing (slightly different from others)
if ($q->isa('CGI::Simple')) {
## get filename
my $fn = $q->param($field);
@@ -318,8 +318,8 @@
}
- ## only CGI.pm just incase for wierd subclasses
- ## generic data object (or CGI), CGi.pm has incomplete fh's nice huh
+ ## only CGI.pm just in case for weird subclasses
+ ## generic data object (or CGI), CGI.pm has incomplete fh's nice huh
if ($q->isa('CGI')) {
use IO::File;
my $fh = $q->upload($field);
@@ -422,7 +422,7 @@
default, it tries to validate JPEG, GIF and PNG images. The params are:
optional hash reference of parameters. A key named I<mime_types> points to
- array refererences of valid values.
+ array references of valid values.
file_format( mime_types => [qw!image/jpeg image/gif image/png!] );
diff -Naur Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Constraints.pm Data-FormValidator-4.49_1/lib/Data/FormValidator/Constraints.pm
--- Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Constraints.pm 2006-10-03 14:14:46.000000000 -0400
+++ Data-FormValidator-4.49_1/lib/Data/FormValidator/Constraints.pm 2006-10-25 01:42:34.231174800 -0400
@@ -869,7 +869,7 @@
It's used internally as part of the interface to the L<Regexp::Commmon>
regular expressions.
-=head3 untainted_constaint_value()
+=head3 untainted_constraint_value()
return $dfv->untainted_constraint_value($match);
@@ -906,9 +906,9 @@
may have been found. See L<Data::FormValidator::Results> for documentation
of that method.
-=head1 BACKWARDS COMPATIBLITY
+=head1 BACKWARDS COMPATIBILITY
-Prior to Data::FormValidator 4.00, contraints were specified a bit differently.
+Prior to Data::FormValidator 4.00, constraints were specified a bit differently.
This older style is still supported.
It was not necessary to explicitly load some constraints into your name space,
@@ -939,7 +939,7 @@
=item L<Data::FormValidator::Constraints::Upload> - validate the bytes, format and dimensions of file uploads
-=item L<Data::FormValidator::Constraints::DateTime> - A newer DateTime constraint module. May save you a step of tranforming the date into a more useful format after it's validated.
+=item L<Data::FormValidator::Constraints::DateTime> - A newer DateTime constraint module. May save you a step of transforming the date into a more useful format after it's validated.
=item L<Data::FormValidator::Constraints::Dates> - the original DFV date constraint module. Try the newer one first!
diff -Naur Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Filters.pm Data-FormValidator-4.49_1/lib/Data/FormValidator/Filters.pm
--- Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Filters.pm 2006-10-03 14:14:46.000000000 -0400
+++ Data-FormValidator-4.49_1/lib/Data/FormValidator/Filters.pm 2006-10-25 01:40:33.658504632 -0400
@@ -67,7 +67,7 @@
I<filters>, I<field_filters>, and I<field_filter_regexp_map> parameters of the
input profile.
-Filters are applied as the first step of validation, possibily modifying a copy
+Filters are applied as the first step of validation, possibly modifying a copy
of the validation before any constraints are checked.
=head1 RECOMMENDED USE
@@ -195,7 +195,7 @@
=head2 alphanum
-Remove non alphanumerical characters from the input.
+Remove non alphanumeric characters from the input.
=cut
diff -Naur Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Results.pm Data-FormValidator-4.49_1/lib/Data/FormValidator/Results.pm
--- Data-FormValidator-4.49_1.orig/lib/Data/FormValidator/Results.pm 2006-10-03 14:14:46.000000000 -0400
+++ Data-FormValidator-4.49_1/lib/Data/FormValidator/Results.pm 2006-10-25 01:39:49.399457392 -0400
@@ -121,7 +121,7 @@
}
}
- # Apply inconditional filters
+ # Apply unconditional filters
foreach my $filter (_arrayify($profile->{filters})) {
if (defined $filter) {
# Qualify symbolic references
@@ -218,7 +218,7 @@
if (ref($deps) eq 'HASH') {
foreach my $key (keys %$deps) {
# Handle case of a key with a single value given as an arrayref
- # There is probably a better, more general soution to this problem.
+ # There is probably a better, more general solution to this problem.
my $val_to_compare;
if ((ref $valid{$field} eq 'ARRAY') and (scalar @{ $valid{$field} } == 1)) {
$val_to_compare = $valid{$field}->[0];
@@ -420,7 +420,7 @@
$value = $r->valid('field');
-If called with one argument in array conect, it returns the values of C<field>
+If called with one argument in array context, it returns the values of C<field>
as an array:
@values = $r->valid('field');
@@ -761,7 +761,7 @@
# INPUT: prefix_string, hash reference
# Copies the hash and prefixes all keys with prefix_string
-# OUTPUT: hash refence
+# OUTPUT: hash reference
sub prefix_hash {
my ($pre,$href) = @_;
die "prefix_hash: need two arguments" unless (scalar @_ == 2);
@@ -1068,7 +1068,7 @@
# params => [ \'zoo' ]
# }
#
-# Still, it's possble, the two bits of logic could be refactored into one location if you cared
+# Still, it's possible, the two bits of logic could be refactored into one location if you cared
# to do that.
sub _create_regexp_common_constraint {
diff -Naur Data-FormValidator-4.49_1.orig/lib/Data/FormValidator.pm Data-FormValidator-4.49_1/lib/Data/FormValidator.pm
--- Data-FormValidator-4.49_1.orig/lib/Data/FormValidator.pm 2006-10-03 14:14:46.000000000 -0400
+++ Data-FormValidator-4.49_1/lib/Data/FormValidator.pm 2006-10-25 01:37:48.460842856 -0400
@@ -587,7 +587,7 @@
a subroutine reference, to supply custom code
This will check the input and return true or false depending on the input's validity.
-By default, the constraint function recieves a L<Data::FormValidator::Results>
+By default, the constraint function receives a L<Data::FormValidator::Results>
object as its first argument, and the value to be validated as the second. To
validate a field based more inputs than just the field itself, see
L<VALIDATING INPUT BASED ON MULTIPLE FIELDS>.
@@ -648,7 +648,7 @@
may not provide untainting.
See L<WRITING YOUR OWN CONSTRAINT ROUTINES> in the Data::FormValidator::Constraints
-documention for more information.
+documentation for more information.
This is overridden by C<untaint_constraint_fields> and C<untaint_regexp_map>.
@@ -666,7 +666,7 @@
untaint_regexp_map => [qr/some_field_\d/],
-Specifies that certain fields will be untained if they pass their constraints
+Specifies that certain fields will be untainted if they pass their constraints
and match one of the regular expressions supplied. This can be set to a single
regex, or an array reference of regexes. The untainted data will be returned
in the valid hash.
@@ -691,7 +691,7 @@
=head2 validator_packages
# load all the constraints and filters from these modules
- validator_packages => [qw(Data::FormValdidator::Constraints::Upload)],
+ validator_packages => [qw(Data::FormValidator::Constraints::Upload)],
This key is used to define other packages which contain constraint routines or
filters. Set this key to a single package name, or an arrayref of several. All
@@ -720,7 +720,7 @@
<span style="color:red;font-weight:bold"><span class="dfv_errors">* %s</span></span>
The C<%s> will be replaced with the message. The effect is that the message
-will appear in bold red with an asterisk before it. This style can be overriden by simply
+will appear in bold red with an asterisk before it. This style can be overridden by simply
defining "dfv_errors" appropriately in a style sheet, or by providing a new format string.
Here's a more complex example that shows how to provide your own default message strings, as well
@@ -747,7 +747,7 @@
# Error messages, keyed by constraint name
# Your constraints must be named to use this.
constraints => {
- 'date_and_time' => 'Not a vaild time format',
+ 'date_and_time' => 'Not a valid time format',
# ...
},
@@ -826,7 +826,7 @@
validator. Another required key is C<params>. The value of the C<params> key
is a reference to an array of the other elements to use in the validation. If
the element is a scalar, it is assumed to be a field name. The field is known
-to Data::FormValidator, the value will be filtered through any defined filteres
+to Data::FormValidator, the value will be filtered through any defined filters
before it is passed in. If the value is a reference, the reference is passed
directly to the routine. Don't forget to include the name of the field to
check in that list, if you are using this syntax.
@@ -846,7 +846,7 @@
be any of the constraint types defined above.
When using multiple constraints it is important to return the name of the
-constraint that failed so you can distinquish between them. To do that,
+constraint that failed so you can distinguish between them. To do that,
either use a named constraint, or use the hash ref method of defining a
constraint and include a C<name> key with a value set to the name of your
constraint. Here's an example:
@@ -1178,7 +1178,7 @@
Japanese: L<http://perldoc.jp/docs/modules/>
-B<Distributions which include Data::formValidator>
+B<Distributions which include Data::FormValidator>
FreeBSD includes a port named B<p5-Data-FormValidator>