Commit Graph

58 Commits

Author SHA1 Message Date
Peter Kokot
f1d7e3ca0b Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:31:31 +02:00
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Christoph M. Becker
33eb30274f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #52974: jewish.c: compile error under Windows with GBK charset
2018-07-22 17:59:38 +02:00
Christoph M. Becker
99fdf5916e Fix #52974: jewish.c: compile error under Windows with GBK charset
jewish.c includes ISO-8859-8 encoded Hebrew Hebrew month names, which
may cause compile errors, and is generally confusing.  We replace the
literal month names with appropriate escape sequences.
2018-07-22 17:42:10 +02:00
Edgar R. Sandi
ebdbebee29
pull-request/2456:
increase test coverage in calendar extension
    consistent warnings in calendar extension
2017-04-08 11:37:10 +01:00
Dmitry Stogov
5e001c34ec Skip 64-bit specific tests on 32-bit systems 2016-11-17 11:44:28 +03:00
Joshua Rogers
1b8cfaf23d Fix integer overflow in calender.
Fix int overflows in conversation functions for calendar.
Add tests for the overflows.
2016-11-12 17:33:51 +00:00
Christoph M. Becker
293dd3d701 Merge branch 'PHP-5.6' into PHP-7.0
# Resolved conflicts:
#	ext/calendar/calendar.c
2016-07-29 01:26:15 +02:00
Christoph M. Becker
f67ccd4a7b Fix #71894: AddressSanitizer: global-buffer-overflow in zif_cal_from_jd
Julian days < 347998 denote invalid Jewish calendar dates, so
cal_from_jd($jd, CAL_JEWISH) and jdmonthname($jd, CAL_MONTH_JEWISH) should
actually fail. For BC we don't yet let them though, but we fix the OOB read
that happens in this case, and we also adjust cal_from_jd()'s return value
to have empty strings for "abbrevdayname" and "dayname" instead of "Sun"/
"Sunday" and NULL for "dow" instead of 0, which doesn't make any sense.
2016-07-29 01:04:21 +02:00
Christoph M. Becker
a952aac6a7 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 20:00:37 +02:00
Christoph M. Becker
5c458c9b02 Implement FR #65462: Please add tests for gregorian and jewish overflow fixes 2016-07-28 19:59:14 +02:00
Christoph M. Becker
7c412688f4 Merge branch 'PHP-5.6' into PHP-7.0 2016-07-28 19:22:40 +02:00
Christoph M. Becker
7ab39e2fae Fix #67976: cal_days_month() fails for final month of the French calendar
The French calendar ends on 0014-13-05, so trying to calculate the Julian
day of 0015-01-01 fails. We cater to that by returning the hard-coded value.
2016-07-28 19:13:58 +02:00
Ferenc Kovacs
c3b44b1175 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixes #67960 - Long/short day names reversed in jddayofweek()

Conflicts:
	ext/calendar/calendar.c
2015-01-02 10:16:37 +01:00
Ferenc Kovacs
fe46966678 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixes #67960 - Long/short day names reversed in jddayofweek()
2015-01-02 10:15:01 +01:00
Greg Roach
244fc1e053 Fixes #67960 - Long/short day names reversed in jddayofweek() 2015-01-02 10:14:12 +01:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Veres Lajos
06fdf359e3 typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-23 14:52:47 -08:00
Veres Lajos
4dc994571d typo fixes - https://github.com/vlajos/misspell_fixer
Conflicts:
	ext/ftp/ftp.h
	ext/pcre/pcrelib/pcre_printint.c
	ext/pcre/pcrelib/sljit/sljitLir.c
	ext/pcre/pcrelib/sljit/sljitLir.h
	ext/pcre/pcrelib/sljit/sljitNativeARM_32.c
	ext/pcre/pcrelib/sljit/sljitNativeTILEGX_64.c
	ext/pgsql/pgsql.c
	ext/phar/func_interceptors.c
	ext/soap/soap.c
	ext/standard/image.c
2014-11-23 14:33:43 -08:00
Remi Collet
d64e8dd7a4 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
  Fixed bug #64895 Integer overflow in SndToJewish
2013-05-22 08:29:30 +02:00
Remi Collet
73eedaf6f7 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #64895 Integer overflow in SndToJewish
2013-05-22 08:29:08 +02:00
Remi Collet
fc2a9d6e47 Fixed bug #64895 Integer overflow in SndToJewish 2013-05-22 08:28:05 +02:00
Remi Collet
4840ff0f05 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Integer overflow in SndToJewish leads to php hang AT least in (inputDay is long, metonicCycle is int):    metonicCycle = (inputDay + 310) / 6940;
2013-05-21 18:09:02 +02:00
Remi Collet
646ebc2cb9 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Integer overflow in SndToJewish leads to php hang AT least in (inputDay is long, metonicCycle is int):    metonicCycle = (inputDay + 310) / 6940;
2013-05-21 18:08:45 +02:00
Remi Collet
4828f7343b Integer overflow in SndToJewish leads to php hang
AT least in (inputDay is long, metonicCycle is int):
   metonicCycle = (inputDay + 310) / 6940;

So large value give strange (negative) results or php hangs.
This is patch already applied in some linux distro.
2013-05-21 18:04:17 +02:00
Stanislav Malyshev
a15459b291 text fixes from emosenkis 2012-08-07 01:48:32 -07:00
Stanislav Malyshev
0826d39370 some fixes for bug#54254 2012-08-07 01:48:31 -07:00
Eitan Mosenkis
dedc8f2682 Add test for interoperability of jdtojewish and cal_days_in_month 2012-08-07 01:48:31 -07:00
Anatoliy Belsky
6f8fae606b Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fix bug 61685 putenv('TZ=UTC') doesn't update timezone for localtime()
2012-04-28 11:44:54 +02:00
Matt Ficken
dc6d283b1c Fix bug 61685 putenv('TZ=UTC') doesn't update timezone for localtime() 2012-04-28 11:42:42 +02:00
Stanislav Malyshev
d81ea16ef1 Changed silent conversion of array to string to produce a notice. (Patrick) 2011-10-21 06:08:47 +00:00
Gustavo André dos Santos Lopes
cb33a3a2c0 - Oops missed return. Also improved the readability of a test. 2011-09-27 11:43:07 +00:00
Gustavo André dos Santos Lopes
736ada5931 - Oops missed return. Also improved the readability of a test. 2011-09-27 11:43:07 +00:00
Gustavo André dos Santos Lopes
74cc4c8cc6 - Added tests and NEWS for r306475; see bug #55797.
- Removed now redundant previous overflow check, which relied on
  undefined behavior (wraparound) and was ignored in optimized builds.
2011-09-27 10:57:25 +00:00
Gustavo André dos Santos Lopes
5ae7564890 - Added tests and NEWS for r306475; see bug #55797.
- Removed now redundant previous overflow check, which relied on
  undefined behavior (wraparound) and was ignored in optimized builds.
2011-09-27 10:57:25 +00:00
Ferenc Kovacs
3b4b1a79b6 split the ext/calendar/tests/bug53574.phpt into two test, as we expect different result on 32 and 64 bit 2011-09-27 00:53:41 +00:00
Ferenc Kovacs
3945c4f9a6 split the ext/calendar/tests/bug53574.phpt into two test, as we expect different result on 32 and 64 bit 2011-09-27 00:53:41 +00:00
Christopher Jones
4e4ad9aa26 Use TZ similar to easter_date.phpt else gcov et al give a diff for unixtojd(1000000000) 2011-09-26 19:13:06 +00:00
Christopher Jones
fe6bd56020 Use TZ similar to easter_date.phpt else gcov et al give a diff for unixtojd(1000000000) 2011-09-26 19:13:06 +00:00
Ferenc Kovacs
f3af205bcb the julian date for timestamp 1000000000 is 2452161.5740741, which is rounded to 2452162 2011-09-22 21:50:45 +00:00
Ferenc Kovacs
f71b3cdd67 the julian date for timestamp 1000000000 is 2452161.5740741, which is rounded to 2452162 2011-09-22 21:50:45 +00:00
Ferenc Kovacs
ee0ecceb80 it seems that easter_date doesn't use the date.timezone but the TZ environment variable, so it passing the return value of easter_date() to date() which uses the date.timezone will create wrong result. 2011-09-22 20:59:10 +00:00
Ferenc Kovacs
0839aee404 it seems that easter_date doesn't use the date.timezone but the TZ environment variable, so it passing the return value of easter_date() to date() which uses the date.timezone will create wrong result. 2011-09-22 20:59:10 +00:00
Gustavo André dos Santos Lopes
f13d9c0e03 - Fixed bug #53574 (Integer overflow in SdnToJulian, sometimes leading to
segfault).
2010-12-19 23:47:00 +00:00
Gustavo André dos Santos Lopes
433dff36d7 - Fixed bug #53574 (Integer overflow in SdnToJulian, sometimes leading to
segfault).
2010-12-19 23:47:00 +00:00
Adam Harvey
97f6da74a1 Fixed bug #52744 (cal_days_in_month incorrect for December 1 BCE). Original
patch by gpap at internet dot gr.
2010-09-09 06:41:23 +00:00
Adam Harvey
c2f2f68692 Fixed bug #52744 (cal_days_in_month incorrect for December 1 BCE). Original
patch by gpap at internet dot gr.
2010-09-09 06:41:23 +00:00
Ilia Alshanetsky
57a912e828 Fixed tests 2006-12-04 18:29:49 +00:00
Hannes Magnusson
e94670d4d6 MFH tests 2006-10-09 16:02:34 +00:00