cvs: php-src(PHP_5_0) /ext/calendar calendar.c
| From: | Dmitry Stogov | Date: | Thu, 07 Apr 2005 16:12:47 +0000 |
| Subject: | cvs: php-src(PHP_5_0) /ext/calendar calendar.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-31279@lists.php.net to get a copy of this message | ||
dmitry Thu Apr 7 12:12:47 2005 EDT
Modified files: (Branch: PHP_5_0)
/php-src/ext/calendar calendar.c
Log:
Fixed wrong result of cal_days_in_month() with bad dates
http://cvs.php.net/diff.php/php-src/ext/calendar/calendar.c?r1=1.40.2.1&r2=1.40.2.2&ty=u
Index: php-src/ext/calendar/calendar.c
diff -u php-src/ext/calendar/calendar.c:1.40.2.1 php-src/ext/calendar/calendar.c:1.40.2.2
--- php-src/ext/calendar/calendar.c:1.40.2.1 Mon Oct 11 02:40:20 2004
+++ php-src/ext/calendar/calendar.c Thu Apr 7 12:12:47 2005
@@ -18,7 +18,7 @@
| Wez Furlong <wez@thebrainroom.com> |
+----------------------------------------------------------------------+
*/
-/* $Id: calendar.c,v 1.40.2.1 2004/10/11 06:40:20 iliaa Exp $ */
+/* $Id: calendar.c,v 1.40.2.2 2005/04/07 16:12:47 dmitry Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -246,6 +246,11 @@
sdn_start = calendar->to_jd(year, month, 1);
+ if (sdn_start == 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid date.");
+ RETURN_FALSE;
+ }
+
sdn_next = calendar->to_jd(year, 1 + month, 1);
if (sdn_next == 0) {