dmitry          Thu Apr  7 12:12:28 2005 EDT

  Modified files:              
    /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.41&r2=1.42&ty=u
Index: php-src/ext/calendar/calendar.c
diff -u php-src/ext/calendar/calendar.c:1.41 
php-src/ext/calendar/calendar.c:1.42
--- php-src/ext/calendar/calendar.c:1.41        Mon Oct 11 02:39:41 2004
+++ php-src/ext/calendar/calendar.c     Thu Apr  7 12:12:27 2005
@@ -18,7 +18,7 @@
    |          Wez Furlong               <[EMAIL PROTECTED]>            |
    +----------------------------------------------------------------------+
  */
-/* $Id: calendar.c,v 1.41 2004/10/11 06:39:41 iliaa Exp $ */
+/* $Id: calendar.c,v 1.42 2005/04/07 16:12:27 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) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to