Fixed wrong result of cal_days_in_month() with bad dates

This commit is contained in:
Dmitry Stogov 2005-04-07 16:12:27 +00:00
parent 779f5c5c19
commit b14271dbfa

View file

@ -246,6 +246,11 @@ PHP_FUNCTION(cal_days_in_month)
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) {