Many systems are optimized to deal with time earlier than
epoch, I suppose. Negative value works fine for me at least
and this patch breaks my script for sure.
Behavior may be system dependent, that's why standard
do not define behavior. I think this is a documentation
problem but a consistency.
I'm -1 for this change.
How about others?
--
Yasuo Ohgaki
Ilia Alshanetsky wrote:
> iliaa Sat Sep 21 11:41:20 2002 EDT
>
> Modified files:
> /php4/ext/standard datetime.c
> Log:
> Fixed bug #12934
> locatime() now returns an error message when passed a negative value.
>
>
> Index: php4/ext/standard/datetime.c
> diff -u php4/ext/standard/datetime.c:1.94 php4/ext/standard/datetime.c:1.95
> --- php4/ext/standard/datetime.c:1.94 Thu Sep 19 14:22:51 2002
> +++ php4/ext/standard/datetime.c Sat Sep 21 11:41:20 2002
> @@ -19,7 +19,7 @@
> */
>
>
> -/* $Id: datetime.c,v 1.94 2002/09/19 18:22:51 iliaa Exp $ */
> +/* $Id: datetime.c,v 1.95 2002/09/21 15:41:20 iliaa Exp $ */
>
>
> #include "php.h"
> @@ -646,7 +646,7 @@
> assoc_array = Z_LVAL_PP(assoc_array_arg);
> break;
> }
> - if (NULL == (ta = php_localtime_r(×tamp, &tmbuf))) {
> + if (timestamp < 0 || NULL == (ta = php_localtime_r(×tamp, &tmbuf))) {
> php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid local time");
> RETURN_FALSE;
> }
>
>
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php