Manual Reference Pages - CGI::UNTAINT::DATE (3)
CGI::Untaint::date - validate a date
my $handler = CGI::Untaint->new($q->Vars);
my $date = $handler->extract(-as_date => date);
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
third Wednesday in March
See Date::Manip for much more information on what date formats are
The resulting date will be a Date::Simple object.
Date::Simple for more information on this.
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()
Date::Manip does not play nicely with taint mode. In order to work
around this we locally clobber Date::Manips timezone code. As were
only interested in dates rather than times, this shouldnt be much of
an issue. If it is, then please let me know!
BUGS and QUERIES
Please direct all correspondence regarding this module to:
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.
|perl v5.20.3 ||CGI::UNTAINT::DATE (3) ||2005-09-26 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.