Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 3.2.13

Bug #2530 strtotime error in HTML/QuickForm/date.php
Submitted: 2004-10-14 10:34 UTC Modified: 2006-12-24 15:56 UTC
From: fizz at beyond dot hjsoft dot com Assigned: avb
Status: Closed Package: HTML_QuickForm
PHP Version: 5.0.2 OS: Fedora Core 1
Roadmaps: (Not assigned)    
Subscription  


 [2004-10-14 10:34 UTC] fizz at beyond dot hjsoft dot com
Description: ------------ On pages that use QuickForm date field type and PHP 5.0.2 it produces a warning as follows: Warning: strtotime() [function.strtotime]: Called with an empty time parameter. in /usr/share/pear/HTML/QuickForm/date.php on line 385 a simple fix is add the following two lines prior to the strtotime call (on line 385). if ($value == NULL) $value = "now"; effectively setting the default value to today if none is set. Expected result: ---------------- No warning message. Actual result: -------------- Warning: strtotime() [function.strtotime]: Called with an empty time parameter. in /usr/share/pear/HTML/QuickForm/date.php on line 387

Comments

 [2004-10-14 12:42 UTC] avb
Where is reproduce code? "On pages that use QuickForm date field type" does not qualify as such.
 [2004-10-14 13:27 UTC] fizz at beyond dot hjsoft dot com
This is the code that caused it. $date = &$this->addElement('date', 'billing_month', 'Billing Month', array('format' => 'FY', 'minYear' => 2004, 'maxYear' => date("Y"))); $date->setValue($billing_timestamp); where $billing_timestamp is not set (so effectively NULL).
 [2004-10-14 14:56 UTC] avb
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.