From: arno dot zandink at gmail dot com Operating system: Windows / Linux PHP version: 5.3.0 PHP Bug Type: Date/time related Bug description: checkdate returns true on false date
Description:
------------
checkdate returns true when the date given is not a valid date
If this is not considered a bug, perhaps adding a waring on the manual
page would be wise
Reproduce code:
---------------
---
>From manual page: function.checkdate
---
<?php
$date = "01-01-1980 <script>alert('test');</script>";
$aDate_parts = preg_split("/[\s-]+/", $date);
var_dump(
checkdate(
$aDate_parts[1], // Month
$aDate_parts[0], // Day
$aDate_parts[2] // Year
)
);
?>
Expected result:
----------------
I would expect var_dump to print a boolean (false) because the date is not
valid
Actual result:
--------------
A boolean (true) is returned with a invalid date
--
Edit bug report at http://bugs.php.net/?id=48906&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48906&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48906&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48906&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48906&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48906&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48906&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48906&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48906&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48906&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48906&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48906&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48906&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48906&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48906&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48906&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48906&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48906&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48906&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48906&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48906&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48906&r=mysqlcfg
