summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorChristoph M. Becker <cmb@php.net>2016-07-28 19:17:56 +0200
committerChristoph M. Becker <cmb@php.net>2016-07-28 19:22:40 +0200
commit7c412688f47005c8c6c375a2d5aae3863ceeebf8 (patch)
tree35cd397edd21e85c62f4daf9a425b411edb21fcb /ext
parent3b48c5a36f7f903ecf206ff5c46a125f7edfee49 (diff)
parent7ab39e2faef499c8a1857205fa332d2e38a0a584 (diff)
downloadphp-git-7c412688f47005c8c6c375a2d5aae3863ceeebf8.tar.gz
Merge branch 'PHP-5.6' into PHP-7.0
Diffstat (limited to 'ext')
-rw-r--r--ext/calendar/calendar.c4
-rw-r--r--ext/calendar/tests/bug67976.phpt12
2 files changed, 16 insertions, 0 deletions
diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c
index 78d772adce..2e0f53e561 100644
--- a/ext/calendar/calendar.c
+++ b/ext/calendar/calendar.c
@@ -357,6 +357,10 @@ PHP_FUNCTION(cal_days_in_month)
}
else {
sdn_next = calendar->to_jd(year + 1, 1, 1);
+ if (cal == CAL_FRENCH && sdn_next == 0) {
+ /* The French calendar ends on 0014-13-05. */
+ sdn_next = 2380953;
+ }
}
}
diff --git a/ext/calendar/tests/bug67976.phpt b/ext/calendar/tests/bug67976.phpt
new file mode 100644
index 0000000000..74e0bc81b1
--- /dev/null
+++ b/ext/calendar/tests/bug67976.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #67976 (cal_days_month() fails for final month of the French calendar)
+--SKIPIF--
+<?php
+if (!extension_loaded('calendar')) die('skip ext/calendar required');
+?>
+--FILE--
+<?php
+var_dump(cal_days_in_month(CAL_FRENCH, 13, 14));
+?>
+--EXPECT--
+int(5)