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

Bug #2530 strtotime error in HTML/QuickForm/date.php
Submitted: 2004-10-14 15:34 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  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 40 + 39 = ?

 
 [2004-10-14 15: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 17:42 UTC] avb
Where is reproduce code? "On pages that use QuickForm date field type" does not qualify as such.
 [2004-10-14 18: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 19: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.