mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
Fixed wrong result of cal_days_in_month() with bad dates
This commit is contained in:
parent
779f5c5c19
commit
b14271dbfa
1 changed files with 5 additions and 0 deletions
|
@ -246,6 +246,11 @@ PHP_FUNCTION(cal_days_in_month)
|
||||||
|
|
||||||
sdn_start = calendar->to_jd(year, month, 1);
|
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);
|
sdn_next = calendar->to_jd(year, 1 + month, 1);
|
||||||
|
|
||||||
if (sdn_next == 0) {
|
if (sdn_next == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue