php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27048 Checkdate() broken
Submitted: 2004-01-26 10:26 UTC Modified: 2004-01-26 20:13 UTC
From: as at web-dillingen dot de Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4CVS OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: as at web-dillingen dot de
New email:
PHP Version: OS:

 

 [2004-01-26 10:26 UTC] as at web-dillingen dot de
Description:
------------
Bug in PHP 4.3.5-dev
When I put a variable into checkdate($month,$day,$year)
 I get an error message, when one variable is empty or not existing.
I haven't found that in other versions.



 





 

Reproduce code:
---------------
PHP 4.3.5-dev

$value is given by <input type=text' name=value'>   It is up to the user. There doesn't need to be a value.


$datum = explode(".",$value);
	   	  $day     = $datum[0];
                             $month = $datum[1];
		  $year    = $datum[2]; 

//******  $day,$month,$year may be empty  ***********

		  $mydatum = new Date_Calc; 
                             if ($mydatum->isValidDate($day,$month,$year)){
                                                   print "Hallo";
                             }
 

Expected result:
----------------
I want to get back "Hallo", when $datum is a Gegorian date.

This code worked fine in all other PHP-verions, but not in PHP 4.3.5-dev

Actual result:
--------------
PHP 4.3.5-dev

Warning: checkdate() expects parameter 2 to be long, string given in /usr/local/lib/php/Date/Calc.php on line 70
Warning: checkdate() expects parameter 1 to be long, string given in /usr/local/lib/php/Date/Calc.php on line 70



isValidDatefrom PEAR just uses checkdate. Not anything else , which is relevant.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-26 20:13 UTC] sniper@php.net
See bug #25530. You can only pass integers to this function.
See also http://www.php.net/checkdate

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 20:01:31 2024 UTC