I got a couple of errors in a form. Both relating to date and time functions. (Multiple instances of 2 distinct errors)

warning: strtotime() [function.strtotime]: Called with an empty time parameter. in /__/htdocs/modules/webform/components/date.inc on line 50.
warning: strtotime() [function.strtotime]: Called with an empty time parameter. in /__/htdocs/modules/webform/components/time.inc on line 59.

 

Easily solved;

 

// $Id: date.inc,v 1.1.2.5 2006/07/15 08:09:21 ullgren Exp $

Line 50

//  $timestamp = strtotime($component['value']);
    $timestamp = strtotime($component['value'] || 'NopeIAmEmpty');

 

// $Id: time.inc,v 1.1.2.4 2006/07/15 08:09:21 ullgren Exp $

Line 59

//  $timestamp = strtotime($component['value']);
    $timestamp = strtotime($component['value'] || 'NopeIAmEmpty');
CommentFileSizeAuthor
#3 webform.strtotime_bug.patch1005 bytesBachusII

Comments

quicksketch’s picture

Status: Active » Closed (fixed)

This was fixed a while back I believe. Please reopen if the problem persists.

BachusII’s picture

The current versions of these files, both HEAD and 4.7 (date.inc v1.13 (HEAD), date.inc v1.1.2.6 (4.7), time.inc v1.14 (HEAD), time.inc v1.1.2.5 (4.7), still show the possibility for this problem.

Mind you, I'm on PHP v5(.0.4). I've noticed more differences in handling with ealier versions of PHP (4.x) that could be a cause for you not having/noticing the problem, if you're on 4.x that is.

Where's the status "tentative (keep an eye on it)" when you need it ;)

BachusII’s picture

Status: Closed (fixed) » Reviewed & tested by the community
StatusFileSize
new1005 bytes

Recently upgraded to webform-5.x-1.2 and the problem remains. Patch included.

Still could be a PHP 5(.0.4) vs. PHP 4 thing.

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

I cleaned this up with a broader if() statement which skips the strtotime() altogether if a default value is not set. The fix is in the development version and will make it into 1.3.

Anonymous’s picture

Status: Fixed » Closed (fixed)