File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ PHP NEWS
1313 . Fixed GH-16240: jdtounix overflow on argument value. (David Carlier)
1414 . Fixed GH-16241: easter_days/easter_date overflow on year argument.
1515 (David Carlier)
16+ . Fixed GH-16263: jddayofweek overflow. (cmb)
1617
1718- CLI:
1819 . Fixed bug GH-16137: duplicate http headers when set several times by
Original file line number Diff line number Diff line change 3333int DayOfWeek (
3434 zend_long sdn )
3535{
36- int dow ;
37-
38- dow = (sdn + 1 ) % 7 ;
39- if (dow >= 0 ) {
40- return (dow );
41- } else {
42- return (dow + 7 );
43- }
36+ return (int )(sdn % 7 + 8 ) % 7 ;
4437}
4538
4639const char * const DayNameShort [7 ] =
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-16258 (jddayofweek overflow on argument)
3+ --EXTENSIONS--
4+ calendar
5+ --FILE--
6+ <?php
7+ jddayofweek (PHP_INT_MAX , 1 );
8+ jddayofweek (PHP_INT_MIN , 1 );
9+ echo "DONE " ;
10+ ?>
11+ --EXPECT--
12+ DONE
You can’t perform that action at this time.
0 commit comments