diff options
author | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-10 16:16:37 +0800 |
---|---|---|
committer | in2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2005-06-10 16:16:37 +0800 |
commit | 3711c5e17dcb4ab5c4215ab33797565e7f9fbf03 (patch) | |
tree | 53fcd90115962b30a6658a7fb48fe12791218260 /util | |
parent | 1dfe9e10e790796c41567a7807d9a6f95b7fc353 (diff) | |
download | pttbbs-3711c5e17dcb4ab5c4215ab33797565e7f9fbf03.tar pttbbs-3711c5e17dcb4ab5c4215ab33797565e7f9fbf03.tar.gz pttbbs-3711c5e17dcb4ab5c4215ab33797565e7f9fbf03.tar.bz2 pttbbs-3711c5e17dcb4ab5c4215ab33797565e7f9fbf03.tar.lz pttbbs-3711c5e17dcb4ab5c4215ab33797565e7f9fbf03.tar.xz pttbbs-3711c5e17dcb4ab5c4215ab33797565e7f9fbf03.tar.zst pttbbs-3711c5e17dcb4ab5c4215ab33797565e7f9fbf03.zip |
skip wrong datetime
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2819 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'util')
-rw-r--r-- | util/waterball.pl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/util/waterball.pl b/util/waterball.pl index 2258356a..a003d1c6 100644 --- a/util/waterball.pl +++ b/util/waterball.pl @@ -68,10 +68,16 @@ sub parse($) $cmode ? $str =~ m|กน(\w+?)\[37;45m\s*(.*).*?\[(\w+)/(\w+)/(\w+) (\w+):(\w+):(\w+)\]| : $str =~ m|^To (\w+):\s*(.*)\[(\d+)/(\d+)/(\d+) (\d+):(\d+):(\d+)\]|; - return (!$month ? () : - ($cmode, $who, - timelocal($sec, $min, $hour, $day, $month - 1, $year), - $say, $_[0])); + return ( !(1 <= $month && $month <= 12 && + 1 <= $day && $day <= 31 && + 0 <= $hour && $hour <= 23 && + 0 <= $min && $min <= 59 && + 0 <= $sec && $sec <= 59 && + 1970 <= $year && $year <= 2038) ? + () : + ($cmode, $who, + timelocal($sec, $min, $hour, $day, $month - 1, $year), + $say, $_[0]) ); } sub output |