cvs: php4 /ext/standard datetime.c
| From: | Ilia Alshanetsky | Date: | Mon, 03 Feb 2003 22:48:26 +0000 |
| Subject: | cvs: php4 /ext/standard datetime.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-18422@lists.php.net to get a copy of this message | ||
iliaa Mon Feb 3 17:48:26 2003 EDT
Modified files:
/php4/ext/standard datetime.c
Log:
Fixed bug #22017 (non descriptive error to appear when timestamp passed to
date() has value < 0. Win32 does not support timestamps prior to midnight
(00:00:00), January 1, 1970).
Index: php4/ext/standard/datetime.c
diff -u php4/ext/standard/datetime.c:1.101 php4/ext/standard/datetime.c:1.102
--- php4/ext/standard/datetime.c:1.101 Sat Jan 11 18:05:19 2003
+++ php4/ext/standard/datetime.c Mon Feb 3 17:48:26 2003
@@ -19,7 +19,7 @@
*/
-/* $Id: datetime.c,v 1.101 2003/01/11 23:05:19 moriyoshi Exp $ */
+/* $Id: datetime.c,v 1.102 2003/02/03 22:48:26 iliaa Exp $ */
#include "php.h"
@@ -286,6 +286,12 @@
}
convert_to_long_ex(timestamp);
the_time = Z_LVAL_PP(timestamp);
+#ifdef PHP_WIN32
+ if (the_time < 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Windows does not support dates prior to
midnight (00:00:00), January 1, 1970");
+ RETURN_FALSE;
+ }
+#endif
break;
default:
WRONG_PARAM_COUNT;