Commit Graph

1886 Commits

Author SHA1 Message Date
m.yakunin
d2cde0bfd3 Fix #70153 \DateInterval incorrectly unserialized
Added a separate macro for reading 'days' property, so that bool(false)
is correctly converted to the proper internal representation.
2019-10-18 15:31:14 +02:00
CJDennis
e3255a4f49 Fix typo
`sizeof("data")-1` and `sizeof("date")-1` are both 4, so no change in behaviour
2019-09-19 11:36:00 +02:00
Joe Watkins
599b94ff14
export php_time 2019-06-19 12:39:51 +02:00
Joe Watkins
65067dff01
Resolve discrepencies between second value yielded by gettimeofday and time, fixes #69044 2019-06-19 08:56:20 +02:00
Craig Duncan
8b53c7232e Add a test for bug #65672 2019-05-30 18:55:42 +01:00
Craig Duncan
dc586bff36 Ensure the internal properties cannot be overwritten 2019-05-30 18:55:36 +01:00
Craig Duncan
5d67271db0 Add tests for DatePeriod properties 2019-05-29 09:47:10 +02:00
Ignace Nyamagana Butera
7b1a4e2400 Fixed bug #77909: DatePeriod::__construct() with invalid recurrence count value
Improve error message on invalid reccurence count

Adding test when reccurence is -1
2019-04-17 09:39:03 +01:00
Nikita Popov
a573c0e9ed Fix unused variable warning 2019-03-18 10:11:00 +01:00
Derick Rethans
ab07bc1fff Fixed 7.2 compat issue 2019-03-17 14:53:56 -04:00
Ignace Nyamagana Butera
6eb83a63e1 Fixed bug #75113: Added DatePeriod::getRecurrences() method. 2019-03-17 14:37:35 -04:00
Derick Rethans
a890c5beb8 Fixed bug #50020 (DateInterval:createDateFromString() silently fails) 2019-02-28 13:50:35 +00:00
Peter Kokot
0ffa84d740 Refactor timelib.m4
The ext/date/lib is bundled library and also includes additional
timelib.m4 macros and checks specific for PHP.

All the checks in the timelib.m4 are already done in the PHP's
configure.ac:
- headers except for io.h and strings.h
- two functions checked strftime and gettimeofday
- if size of longint is 8
- if size of int is 4
- int32_t and uint32_t types using the PHP_CHECK_STDINT_TYPES

Macro `AC_TIMELIB_C_BIGENDIAN` defined in timelib.m4 is not used.

The two checkings for strtoll and atoll have been moved to date extension's
config0.m4 file.

Additional check for headers <io.h> and <strings.h> has been added to
config0.m4 of the date extension.

Therefore the timelib.m4 can be simplified and removed from the bundled
library to have easier maintenance in the later branches and also
upstream library.
2019-02-13 19:24:39 +01:00
Nikita Popov
a109fddba4 Remove "defensive copy" of DatePeriod properties
get_properties() constructs these as fresh objects with no relation
to the internals, there is no need to clone them again. Additionally
the current implementation leaks memory, because the original objects
are never freed (see PR #3121).
2019-02-12 09:54:52 +01:00
Derick Rethans
bd1d2c7bfe Update tests due to data changes in tzdata 2018i 2019-01-07 12:48:42 +00:00
Derick Rethans
81da7f75e3 Updated to version 2018.9 (2018i) 2019-01-07 11:50:14 +00:00
Derick Rethans
a3f2871b8e Fixed bug #77097 (DateTime::diff gives wrong diff when the actual diff is less than 1 second) by upgrading to timelib 2017.09 2018-11-28 20:34:21 +00:00
Derick Rethans
10255a0cd9 Updated to version 2018.7 (2018g) 2018-10-30 11:25:48 +00:00
Derick Rethans
c3a8313136 Updated to version 2018.6 (2018f) 2018-10-22 12:05:40 +01:00
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
Derick Rethans
94a98f2c63 Upgrade timelib to 2017.08, to fix bug #77007 2018-10-12 11:41:05 +01:00
Christoph M. Becker
1b97f291a7 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #75851: Year component overflow with date formats "c", "o", "r" and "y"
2018-10-08 11:50:37 +02:00
Adam Saponara
c097acd52e Fix #75851: Year component overflow with date formats "c", "o", "r" and "y" 2018-10-08 11:48:58 +02:00
Anatol Belski
5f1190684f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #76462 Undefined property: DateInterval::$f
2018-06-12 15:31:01 +02:00
Anatol Belski
7212829435 Fixed bug #76462 Undefined property: DateInterval::$f 2018-06-12 15:30:14 +02:00
Nikita Popov
e029019275 Deduplicate code using php_timezone_to_string()
Looks like this usage was overlooked when the function was
introduced.
2018-06-08 23:10:43 +02:00
David Carlier
ad52ec3db8 cast to int to disable compilation warnings. 2018-06-08 23:08:42 +02:00
Derick Rethans
1a25137a69 Updated to version 2018.5 (2018e) 2018-05-08 09:24:27 +01:00
Derick Rethans
d057d767cc Updated to version 2018.5 (2018e) 2018-05-08 09:24:25 +01:00
Joe Watkins
3e267ca91b
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #76131 some arginfo params are different from the documentation
2018-03-27 21:58:24 +02:00
Gabriel Caruso
63934ea71e
Fix #76131 some arginfo params are different from the documentation 2018-03-27 21:56:46 +02:00
Derick Rethans
c72c4c5271 Updated to version 2018.4 (2018d) 2018-03-24 11:26:16 +00:00
Derick Rethans
869ca9b733 Updated to version 2018.4 (2018d) 2018-03-24 11:26:15 +00:00
Remi Collet
17164bcf8d factorization of duplicated code 2018-02-14 13:15:09 +01:00
Remi Collet
528bc00d84 Fix timezone var_dump from 51f2a5803f 2018-02-14 08:59:24 +01:00
Joe
8c1147b089
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #68406 calling var_dump on a DateTimeZone object modifies it
2018-02-12 09:19:11 +01:00
jhdxr
070211b3e3
Fixed bug #68406 calling var_dump on a DateTimeZone object modifies it 2018-02-12 09:17:21 +01:00
Christoph M. Becker
7554fd9101 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #75857: Timezone gets truncated when formatted
2018-02-11 12:49:41 +01:00
Gabriel Caruso
f706937120 Fix #75857: Timezone gets truncated when formatted
Use sizeof buffer instead of hard-coded lenghts
2018-02-11 03:14:41 +01:00
Nikita Popov
ee3f3a9d75 Merge branch 'PHP-7.1' into PHP-7.2 2018-02-10 19:30:57 +01:00
Pedro Lacerda
fddd7e38bd Fixed bug #75928 2018-02-10 19:29:47 +01:00
Derick Rethans
5feb53964f Sync with timelib 2017.06 2018-01-31 11:55:35 +00:00
Derick Rethans
6dbe046154 Updated to version 2018.3 (2018c) 2018-01-24 13:57:07 +00:00
Derick Rethans
f80e59a566 Updated to version 2018.3 (2018c) 2018-01-24 13:57:06 +00:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Derick Rethans
466a34d67c Revert "date module, replacing abs call with the llabs's like one due to bigger type"
This reverts commit c189845951.
2017-11-07 14:52:12 +00:00
Derick Rethans
ba9df1cff6 Fixed ext/date tests due to changes in Olson database 2017-11-07 11:34:55 +00:00