r13561 - in /branches/upstream/libcgi-untaint-date-perl: ./ current/ current/lib/ current/lib/CGI/ current/lib/CGI/Untaint/ current/t/

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Sat Jan 26 08:02:26 UTC 2008


Author: dmn
Date: Sat Jan 26 08:02:25 2008
New Revision: 13561

URL: http://svn.debian.org/wsvn/?sc=1&rev=13561
Log:
[svn-inject] Installing original source of libcgi-untaint-date-perl

Added:
    branches/upstream/libcgi-untaint-date-perl/
    branches/upstream/libcgi-untaint-date-perl/current/
    branches/upstream/libcgi-untaint-date-perl/current/Changes
    branches/upstream/libcgi-untaint-date-perl/current/MANIFEST
    branches/upstream/libcgi-untaint-date-perl/current/MANIFEST.SKIP
    branches/upstream/libcgi-untaint-date-perl/current/META.yml
    branches/upstream/libcgi-untaint-date-perl/current/Makefile.PL
    branches/upstream/libcgi-untaint-date-perl/current/README
    branches/upstream/libcgi-untaint-date-perl/current/lib/
    branches/upstream/libcgi-untaint-date-perl/current/lib/CGI/
    branches/upstream/libcgi-untaint-date-perl/current/lib/CGI/Untaint/
    branches/upstream/libcgi-untaint-date-perl/current/lib/CGI/Untaint/date.pm
    branches/upstream/libcgi-untaint-date-perl/current/t/
    branches/upstream/libcgi-untaint-date-perl/current/t/date.t
    branches/upstream/libcgi-untaint-date-perl/current/t/pod-coverage.t
    branches/upstream/libcgi-untaint-date-perl/current/t/pod.t

Added: branches/upstream/libcgi-untaint-date-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/Changes?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/Changes (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/Changes Sat Jan 26 08:02:25 2008
@@ -1,0 +1,16 @@
+Revision history 
+
+1.00  Mon Sep 26 13:58:49 UTC 2005
+	+ Fix documentation for UK vs US date formats 
+  + Allow easier overriding of date format preferences
+
+0.03  Sun Feb  3 14:22:29 GMT 2002
+	+ The CPAN shell doesn't like my prerequisites
+
+0.02  Sun Dec 16 20:29:34 GMT 2001
+	+ Made taint safe. (Ironic, isn't it)
+
+0.01  Fri Oct 26 14:46:53 BST 2001
+	- Created this
+
+

Added: branches/upstream/libcgi-untaint-date-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/MANIFEST?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/MANIFEST (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/MANIFEST Sat Jan 26 08:02:25 2008
@@ -1,0 +1,10 @@
+Changes
+lib/CGI/Untaint/date.pm
+Makefile.PL
+MANIFEST			This list of files
+MANIFEST.SKIP
+META.yml
+README
+t/date.t
+t/pod-coverage.t
+t/pod.t

Added: branches/upstream/libcgi-untaint-date-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/MANIFEST.SKIP?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/MANIFEST.SKIP (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/MANIFEST.SKIP Sat Jan 26 08:02:25 2008
@@ -1,0 +1,32 @@
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+,v$
+,B$
+,D$
+\B\.svn\b
+aegis.log$
+\bconfig$
+\bbuild$
+
+# Avoid Makemaker generated and utility files.
+\bMakefile$
+\bblib
+\bMakeMaker-\d
+\bpm_to_blib$
+\bblibdirs$
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build
+
+# Avoid temp and backup files.
+~$
+\.gz$
+\.old$
+\.bak$
+\.swp$
+\.tdy$
+\#$
+\b\.#
+

Added: branches/upstream/libcgi-untaint-date-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/META.yml?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/META.yml (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/META.yml Sat Jan 26 08:02:25 2008
@@ -1,0 +1,13 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         CGI-Untaint-date
+version:      1.00
+version_from: lib/CGI/Untaint/date.pm
+installdirs:  site
+requires:
+    CGI::Untaint:                  0.07
+    Date::Manip:                   5
+    Date::Simple:                  0.01
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.17

Added: branches/upstream/libcgi-untaint-date-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/Makefile.PL?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/Makefile.PL (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/Makefile.PL Sat Jan 26 08:02:25 2008
@@ -1,0 +1,15 @@
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+    NAME		=> 'CGI::Untaint::date',
+    VERSION_FROM	=> 'lib/CGI/Untaint/date.pm', 
+    PREREQ_PM		=> { 
+                              CGI::Untaint => 0.07,
+                              Date::Manip  => 5.00,
+                              Date::Simple => 0.01,
+                           }, 
+    ($] > 5.005 ? () : (
+      ABSTRACT_FROM => 'lib/CGI/Untaint/date.pm', 
+      AUTHOR        => 'Tony Bowden <kasei at tmtm.com>',
+    )),
+);

Added: branches/upstream/libcgi-untaint-date-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/README?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/README (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/README Sat Jan 26 08:02:25 2008
@@ -1,0 +1,50 @@
+NAME
+    CGI::Untaint::date - validate a date
+
+SYNOPSIS
+      use CGI::Untaint;
+      my $handler = CGI::Untaint->new($q->Vars);
+
+      my $date = $handler->extract(-as_date => 'date');
+
+DESCRIPTION
+  is_valid
+    This Input Handler verifies that it is dealing with a reasonable date.
+    Reasonably means anything that Date::Manip thinks is sensible, so you
+    could use any of (for example): "December 12, 2001" "12th December,
+    2001" "2001-12-12" "next Tuesday" "third Wednesday in March"
+
+    See Date::Manip for much more information on what date formats are
+    acceptable.
+
+    The resulting date will be a Date::Simple object. Date::Simple for more
+    information on this.
+
+  date_format
+    By default ambiguous dates of the format 08/09/2001 will be treated as
+    UK style (i.e. 8th September rather than 9th August)
+
+    If you want to change this, subclass it and override date_format()
+
+WARNING
+    Date::Manip does not play nicely with taint mode. In order to work
+    around this we locally clobber Date::Manip's 'timezone' code. As we're
+    only interested in dates rather than times, this shouldn't be much of an
+    issue. If it is, then please let me know!
+
+SEE ALSO
+    Date::Simple. Date::Manip.
+
+AUTHOR
+    Tony Bowden
+
+BUGS and QUERIES
+    Please direct all correspondence regarding this module to:
+    bug-CGI-Untaint-date at rt.cpan.org
+
+COPYRIGHT and LICENSE
+    Copyright (C) 2001-2005 Tony Bowden. All rights reserved.
+
+    This module is free software; you can redistribute it and/or modify it
+    under the same terms as Perl itself.
+

Added: branches/upstream/libcgi-untaint-date-perl/current/lib/CGI/Untaint/date.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/lib/CGI/Untaint/date.pm?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/lib/CGI/Untaint/date.pm (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/lib/CGI/Untaint/date.pm Sat Jan 26 08:02:25 2008
@@ -1,0 +1,90 @@
+package CGI::Untaint::date;
+
+$VERSION = '1.00';
+
+use strict;
+use base 'CGI::Untaint::printable';
+use Date::Manip;
+use Date::Simple;
+
+sub is_valid {
+  my $self = shift;
+  local $SIG{__WARN__} = sub {};
+  local *Date::Manip::Date_TimeZone = sub { 'GMT' };
+  Date_Init(sprintf 'DateFormat=%s' => $self->date_format);
+  my $date = ParseDate($self->value) or return;
+  my @date = unpack "A4A2A2", $date;
+  my $ds = eval { Date::Simple->new(@date) } or return;
+  $self->value($ds);
+  return $ds;
+}
+
+sub date_format { 'UK' }
+
+=head1 NAME
+
+CGI::Untaint::date - validate a date
+
+=head1 SYNOPSIS
+
+  use CGI::Untaint;
+  my $handler = CGI::Untaint->new($q->Vars);
+
+  my $date = $handler->extract(-as_date => 'date');
+
+=head1 DESCRIPTION
+
+=head2 is_valid
+
+This Input Handler verifies that it is dealing with a reasonable
+date. Reasonably means anything that Date::Manip thinks is
+sensible, so you could use any of (for example):
+  "December 12, 2001"
+  "12th December, 2001"
+  "2001-12-12"
+  "next Tuesday"
+  "third Wednesday in March"
+
+See L<Date::Manip> for much more information on what date formats are
+acceptable.
+
+The resulting date will be a Date::Simple object. 
+L<Date::Simple> for more information on this.
+
+=head2 date_format
+
+By default ambiguous dates of the format 08/09/2001 will be treated as
+UK style (i.e. 8th September rather than 9th August)
+
+If you want to change this, subclass it and override date_format()
+
+=head1 WARNING
+
+Date::Manip does not play nicely with taint mode. In order to work
+around this we locally clobber Date::Manip's 'timezone' code. As we're
+only interested in dates rather than times, this shouldn't be much of
+an issue. If it is, then please let me know!
+
+=head1 SEE ALSO
+
+L<Date::Simple>. L<Date::Manip>.
+
+=head1 AUTHOR
+
+Tony Bowden
+
+=head1 BUGS and QUERIES
+
+Please direct all correspondence regarding this module to:
+  bug-CGI-Untaint-date at rt.cpan.org
+
+=head1 COPYRIGHT and LICENSE
+
+Copyright (C) 2001-2005 Tony Bowden. All rights reserved.
+
+This module is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut
+
+1;

Added: branches/upstream/libcgi-untaint-date-perl/current/t/date.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/t/date.t?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/t/date.t (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/t/date.t Sat Jan 26 08:02:25 2008
@@ -1,0 +1,27 @@
+#!/usr/bin/perl -Tw
+
+use Test::More tests => 5;
+
+use strict;
+use CGI;
+use CGI::Untaint;
+
+my @dates = (
+  "December 12, 2001",
+  "12th December, 2001",     
+  "2001-12-12",              
+  "second Wednesday in December, 2001",
+);
+
+my $count = 0;
+my %hash = map { "var" . ++$count => $_ } @dates;
+my $q = CGI->new(\%hash);
+
+ok(my $data = CGI::Untaint->new( $q->Vars ), "Can create the handler");
+
+$count = 0;
+foreach (@dates) {
+  ++$count;
+  is $data->extract(-as_date => "var$count")->format, "2001-12-12",
+    "$_ = 2001-12-12";
+}

Added: branches/upstream/libcgi-untaint-date-perl/current/t/pod-coverage.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/t/pod-coverage.t?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/t/pod-coverage.t (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/t/pod-coverage.t Sat Jan 26 08:02:25 2008
@@ -1,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod::Coverage 1.00";
+plan skip_all => "Test::Pod::Coverage 1.00 required for testing POD coverage" if $@;
+all_pod_coverage_ok();

Added: branches/upstream/libcgi-untaint-date-perl/current/t/pod.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcgi-untaint-date-perl/current/t/pod.t?rev=13561&op=file
==============================================================================
--- branches/upstream/libcgi-untaint-date-perl/current/t/pod.t (added)
+++ branches/upstream/libcgi-untaint-date-perl/current/t/pod.t Sat Jan 26 08:02:25 2008
@@ -1,0 +1,4 @@
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();




More information about the Pkg-perl-cvs-commits mailing list