[SMARTY-DEV] php-notice in plugins/function.html_select_date.php
| From: | matled | Date: | Tue, 11 Jun 2002 14:45:45 +0000 |
| Subject: | [SMARTY-DEV] php-notice in plugins/function.html_select_date.php | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-137@lists.php.net to get a copy of this message | ||
I just ran the example coming with smarty and got directly this tow
notices:
Notice: Undefined variable: time in [...]/smarty/plugins/function.html_select_date.php on line 59
Notice: Undefined variable: time in [...]/smarty/plugins/function.html_select_date.php on line 63
I would suggest to add this below line 23:
$time = strftime('%Y-%m-%d');
Another thing I saw while reading the code for solving this notices
was the function smarty_make_timestamp
(plugins/shared.make_timestamp.php). I think it would be useful if
it returns always a valid timestamp. This is not sure because of:
// can't decipher, just return it
return $string;
I think it should be checked if $string is a timestamp and if not it
should return a valid one. Perhaps something as this:
if((int)$time > 0)
return (int)$time;
else
return time();