Commit graph

49866 commits

Author SHA1 Message Date
Christoph M. Becker
6f663c3a2e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77391: 1bpp BMPs may fail to be loaded
2018-12-31 20:50:19 +01:00
Christoph M. Becker
b0cfa28d6d Fix #77391: 1bpp BMPs may fail to be loaded
We port the upstream fix[1].

[1] <d0859134fc>
2018-12-31 20:45:47 +01:00
Christoph M. Becker
0f9d369921 Merge branch 'PHP-7.3'
* PHP-7.3:
  Regenerate certs for openssl tests
2018-12-31 18:28:11 +01:00
Christoph M. Becker
b051ab56dc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Regenerate certs for openssl tests
2018-12-31 18:27:26 +01:00
Alexander Kurilo
687dad3674 Regenerate certs for openssl tests 2018-12-31 18:20:34 +01:00
Anatol Belski
67c0415d86 Merge branch 'PHP-7.3'
* PHP-7.3:
  Increase timeout for test on AppVeyor
2018-12-29 17:52:10 +01:00
Anatol Belski
d4b7cc1dba Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Increase timeout for test on AppVeyor
2018-12-29 17:51:39 +01:00
Anatol Belski
54a2b42778 Increase timeout for test on AppVeyor 2018-12-29 17:48:25 +01:00
Anatol Belski
a11e7d2c1f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77346 webm files incorrectly detected as application/octet-stream
2018-12-28 13:27:31 +01:00
Anatol Belski
d874d4a15c Fixed bug #77346 webm files incorrectly detected as application/octet-stream
HEADSUP data from file 5.34 is used from now on
2018-12-28 13:25:40 +01:00
Dmitry Stogov
76d8f3923e Revert HASH_FLAG_INITIALIZED into HASH_FLAG_UNINITIALIZED. 2018-12-28 11:22:18 +03:00
Dmitry Stogov
c706adaaab Added missing invalidations. 2018-12-28 00:14:49 +03:00
Dmitry Stogov
675a8a64c3 Use HT_IS_INITIALIZED() and HT_INVALIDATE() macros instead of hackish HT_FLAGS assumtions. 2018-12-27 22:48:25 +03:00
Dmitry Stogov
c2179309f4 Removed useless check 2018-12-27 22:35:37 +03:00
Nikita Popov
cd7601ebfc Merge branch 'PHP-7.3' 2018-12-27 15:34:22 +01:00
Lauri Kenttä
16c62a8179 Fix #77360: class_uses causes segfault 2018-12-27 15:34:02 +01:00
Nikita Popov
6a06190850 Merge branch 'PHP-7.3' 2018-12-27 15:29:51 +01:00
Lauri Kenttä
89bf3df67d Fix #77359: spl_autoload causes segfault
Use the correct function to free the string.
2018-12-27 15:28:25 +01:00
Dmitry Stogov
9bf80ef385 Respect static method visibility 2018-12-27 10:42:52 +03:00
Nikita Popov
0bbfebb6d9 Add SCCP support for ZEND_ARRAY_KEY_EXISTS 2018-12-26 23:54:11 +03:00
Michael Moravec
f5044a12dd Implement ZEND_ARRAY_KEY_EXISTS opcode to speed up array_key_exists() 2018-12-26 23:54:11 +03:00
Anatol Belski
8789348364 Merge branch 'PHP-7.3'
* PHP-7.3:
  Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839.
2018-12-26 19:03:04 +01:00
Anatol Belski
e38e44e3c6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839.
2018-12-26 19:01:36 +01:00
Michael Meyer
3c42c784c2 Initialize s_un (sockaddr_un) to zero before using it. Fixes #76839. 2018-12-26 18:58:27 +01:00
Nikita Popov
27e9c05e81 Remove preg_options param from pcre_get_compiled_regex()
This parameter is always zero and not necessary to call pcre2_match.

I'm leaving the parameter behind on the _ex() variant, so the preg_flags
are still accessible in some way.
2018-12-26 17:20:13 +01:00
Nikita Popov
fc30c0f7ad Merge branch 'PHP-7.3' 2018-12-26 17:13:21 +01:00
Nikita Popov
b1deb98c42 Fixed bug #77338
Set preg_options to 0 in php_pcre_get_compiled_regex(_ex). These
options are intended to be passed to pcre2_match. However, we do
not have any flags that actually need to be set during matching
(all relevant flags are set during compilation), and the preg_flags
value is used for PHP-specific flags instead.

This parameter should be removed entirely in master to avoid confusion.
2018-12-26 17:11:27 +01:00
Nikita Popov
e595f5cd8a Migrate ext/zlib to use pkg-config
There are other extensions checking for zlib as well, not quite
sure what to do there with regard to option names.
2018-12-26 16:59:24 +01:00
Eli Schwartz
c1a22f3d4e Require pkg-config for external PCRE
Use standard PKG_CHECK_MODULES macro and remove the fallback case.
The option is renamed to --with-external-pcre and no longer accepts
an explicit path -- it should be specified through pkg-config instead.
2018-12-26 13:51:15 +01:00
Eli Schwartz
285a077c12 ext/gd: use --with instead of --enable
By convention it probably makes sense to stick with this even when
dropping the *-dir=DIR part.

See:
https://github.com/php/php-src/pull/3632#discussion_r229474568
https://autotools.io/autoconf/arguments.html
2018-12-26 13:37:39 +01:00
Dmitry Stogov
cbf642b715 Create object only after parameter checks 2018-12-26 13:06:33 +03:00
Dmitry Stogov
22c9d19144 Removed useless zval_ptr_dtor(return_value) 2018-12-26 12:58:11 +03:00
Nikita Popov
1fbc309e2c Merge branch 'PHP-7.3' 2018-12-23 20:21:16 +01:00
Nikita Popov
69f54dd549 Merge branch 'PHP-7.2' into PHP-7.3 2018-12-23 20:20:53 +01:00
Nikita Popov
64de5bc224 Fix invalid efree in browscap
Related to bug #77338.
2018-12-23 20:20:04 +01:00
Derick Rethans
e7e8112fcd Merge branch 'PHP-7.3' 2018-12-23 17:57:23 +00:00
Derick Rethans
a9a084c092 Update API use due to changes in timelib 2018.01RC3 2018-12-23 17:54:57 +00:00
Derick Rethans
3e4a3d005a Upgrade timelib to 2018.01RC3 2018-12-23 17:54:37 +00:00
Christoph M. Becker
9a095416b7 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77298: segfault occurs when add property to unserialized empty ArrayObject
2018-12-21 17:47:02 +01:00
CHU Zhaowei
b15189f4d8 Fix #77298: segfault occurs when add property to unserialized empty ArrayObject 2018-12-21 17:45:52 +01:00
Dmitry Stogov
9acfe1f8f0 Fixed compilation warnings 2018-12-19 16:15:49 +03:00
Dmitry Stogov
cec091176c Replace zend_hash_apply... with ZEND_HASH_FOREACH... 2018-12-19 02:49:56 +03:00
Nikita Popov
da1e6679b7 CFG construction: Avoid code duplication
These code for those two cases is the same nowadays, so merge them.
2018-12-17 11:29:23 +01:00
Christoph M. Becker
cde2e35bf0 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fix #77297: SodiumException segfaults on PHP 7.3
2018-12-16 16:37:15 +01:00
Scott
e0e08d376e Fix #77297: SodiumException segfaults on PHP 7.3
Instead of trying to clean the argument arrays from the backtrace, we
overwrite them with empty arrays.
2018-12-16 16:36:47 +01:00
BohwaZ
82af24f2b2 Implement SQLite3Stmt::getSQL method, returning the original statement SQL, eventually expanded 2018-12-15 17:27:33 +01:00
Christoph M. Becker
3b0f051193 Allow empty $escape to eschew escaping CSV
Albeit CSV is still a widespread data exchange format, it has never been
officially standardized.  There exists, however, the “informational” RFC
4180[1] which has no notion of escape characters, but rather defines
`escaped` as strings enclosed in double-quotes where contained
double-quotes have to be doubled.  While this concept is supported by
PHP's implementation (`$enclosure`), the `$escape` sometimes interferes,
so that `fgetcsv()` is unable to correctly parse externally generated
CSV, and `fputcsv()` is sometimes generating non-compliant CSV.  Since
PHP's `$escape` concept is availble for many years, we cannot drop it
for BC reasons (even though many consider it as bug).  Instead we allow
to pass an empty string as `$escape` parameter to the respective
functions, which results in ignoring/omitting any escaping, and as such
is more inline with RFC 4180.  It is noteworthy that this is almost no
userland BC break, since formerly most functions did not accept an empty
string, and failed in this case.  The only exception was `str_getcsv()`
which did accept an empty string, and used a backslash as escape
character then (which appears to be unintended behavior, anyway).

The changed functions are `fputcsv()`, `fgetcsv()` and `str_getcsv()`,
and also the `::setCsvControl()`, `::getCsvControl()`, `::fputcsv()`,
and `::fgetcsv()` methods of `SplFileObject`.

The implementation also changes the type of the escape parameter of the
PHP_APIs `php_fgetcsv()` and `php_fputcsv()` from `char` to `int`, where
`PHP_CSV_NO_ESCAPE` means to ignore/omit escaping.  The parameter
accepts the same values as `isalpha()` and friends, i.e. “the value of
which shall be representable as an `unsigned char` or shall equal the
value of the macro `EOF`.  If the argument has any other value, the
behavior is undefined.”  This is a subtle BC break, since the character
`chr(128)` has the value `-1` if `char` is signed, and so likely would
be confused with `EOF` when converted to `int`.  We consider this BC
break to be acceptable, since it's rather unlikely that anybody uses
`chr(128)` as escape character, and it easily can be fixed by casting
all `escape` arguments to `unsigned char`.

This patch implements the feature requests 38301[2] and 51496[3].

[1] <https://tools.ietf.org/html/rfc4180>
[2] <https://bugs.php.net/bug.php?id=38301>
[3] <https://bugs.php.net/bug.php?id=51496>
2018-12-15 14:38:15 +01:00
Dmitry Stogov
d206630f13 Fixed memory leaks 2018-12-13 16:21:08 +03:00
Dmitry Stogov
db30e0ce16 Improve unserialize() 2018-12-13 12:55:29 +03:00
Dmitry Stogov
71f430cf06 Improve unserialize() 2018-12-12 20:04:36 +03:00