Commit Graph

12107 Commits

Author SHA1 Message Date
Nikita Popov
bd4fce4f6f Fixed bug #78986
Don't assume that handlers live in the arena, they may also be in
SHM.
2019-12-18 11:40:58 +01:00
Christoph M. Becker
4cd6d384bd Fix #78976: SplFileObject::fputcsv returns -1 on failure
`php_stream_write()` returns `-1` on failure now, which has to be
catered to by `SplFileObject::fputcsv()` which still is supposed to
return `false` on failure.
2019-12-17 17:52:18 +01:00
Nikita Popov
11b041d3c6 Fixed bug #78973
Save opline in leave helper to correctly handle destructor calls
during CV freeing (or other leave freeing).
2019-12-16 18:52:30 +01:00
Dmitry Stogov
6ef7e53c1b Fixed bug #78961 (erroneous optimization of re-assigned $GLOBALS) 2019-12-16 12:24:47 +03:00
Nikita Popov
0f2cdbf214 Introduce extra counter to avoid RTD key collisions
Also generate a fatal error if a collision occurs in zend_compile.

This is not perfect, because collisions might still be introduced
via opcache, if one file is included multiple times during a request,
invalidate in the meantime and recompiled by different processes.

This still needs to be addressed, but this patch fixes the much
more common case of collisions occuring when opcache is not used.

Fixes bug #78903.
2019-12-13 11:04:44 +01:00
Kachalin Alexey
79376ab209 Fix #78929: plus signs in cookie values are converted to spaces
We switch the cookie value parsing function from `php_url_decode()` to
`php_raw_url_decode()`, so that cookie values are now parsed according
to RFC 6265, section 4.1.1.  We also refactor to remove duplicate code
without changing the execution flow.
2019-12-12 14:21:46 +01:00
Nikita Popov
be89a5c7f1 Fixed bug #78950: Preloading trait method with static variables
We need to make sure that trait methods with static variables
allocate a separate MAP slot for the static variables pointer,
rather than working in-place.
2019-12-12 11:52:43 +01:00
Nikita Popov
502cd7b1f1 Revert "Fixed bug #78903: Conflict in RTD key for closures results in crash"
This reverts commit b55033fa18.

This breaks ext/opcache/tests/bug65915.phpt.
2019-12-11 14:38:48 +01:00
Nikita Popov
b55033fa18 Fixed bug #78903: Conflict in RTD key for closures results in crash
I wasn't able to create a simple reproducer for this. General approach
is the same as for anonymous classes: If the key is already used, reuse
the old definition.
2019-12-11 13:07:45 +01:00
Derick Rethans
2badeb511b PHP-7.4 is now 7.4.2-dev 2019-12-10 16:56:33 +00:00
Nikita Popov
3f86adb0ef Fixed bug #78935: Check that all linked classes can be preloaded
During preloading, check that all classes that have been included
as part of the preload script itself (rather than through opcache_compile_file)
can actually be preloaded, i.e. satisfy Windows restrictions, have
resolved initializers and resolved property types. When resolving
initializers and property types, also autoload additional classes.
Because of this, the resolution runs in a loop.
2019-12-10 13:05:48 +01:00
Christoph M. Becker
505cc77cbe Fix #78912: INTL Support for accounting format
We provide `NumberFormatter::CURRENCY_ACCOUNTING` to wrap
`UNUM_CURRENCY_ACCOUNTING `[1].

[1] <https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/unum_8h.html#a4eb4d3ff13bd506e7078b2be4052266dae97cdd7ed612d07d251021c076efb1c5>
2019-12-09 16:34:56 +01:00
Dmitry Stogov
42a2fb8411 Fixed bug #78895 (Reflection detects abstract non-static class as abstract static. IS_IMPLICIT_ABSTRACT is not longer used) 2019-12-09 13:49:12 +03:00
Nikita Popov
32c1f37574 Fixed bug #78926: Handle class table reallocation on failed link
When we change back the bucket key on a class linking failure,
make sure to reload the bucket pointer, as the class table may
have been reallocated in the meantime.

Also remove a bogus bucket key change in anon class registration:
We don't actually rename the class in this case anymore, the RTD
key is already the final name.
2019-12-09 09:15:27 +01:00
Nikita Popov
84354c62b3 Fixed bug #78904: Don't call any magic for uninitialized typed properties
We already changed the behavior for __set() in f1848a4. However, it
seems that this is also a problem for all the other property magic,
see bug #78904.

This commit makes the behavior of all the property magic consistent:
Magic will not be triggered for uninitialized typed properties, only
explicitly unset() ones. This brings behavior more in line how
non-typed properties behave and avoids WTF.

Closes GH-4974.
2019-12-09 08:40:53 +01:00
Jakub Zelenka
ac042f839f Fix bug #78916 (php-fpm 7.4.0 don't send mail via mail()) 2019-12-08 17:57:17 +00:00
Christoph M. Becker
aba070e630 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78923: Artifacts when convoluting image with transparency
2019-12-07 12:08:30 +01:00
willson-chen
b5d2cbe027 Fix #78923: Artifacts when convoluting image with transparency
We have to properly initialize `pxl` before using it.

Fix ported from <https://github.com/libgd/libgd/pull/559>.
2019-12-07 12:06:33 +01:00
Arjen de Korte
ee4295b4ce Fix bug #78823: add zlib library to mysqlnd
The problem is newer binutils will no longer default to --copy-dt-needed-entries but use --no-copy-dt-needed-entries instead. So all libraries needed *must* be provided.

Workarounds (either one works)
1) Add "-Wl,--copy-dt-needed-entries" to LDFLAGS to bring back the old behavior of the linker
2) Add "-lz" to list of libraries to be added

In "ext/mysqlnd/mysqlnd_protocol_frame_codec.c" when the "zlib.h" header is included should also trigger adding '-lz' to the list of libraries.
2019-12-05 07:24:52 +01:00
Nikita Popov
6540797f1e Fixed bug #78898 2019-12-04 09:40:48 +01:00
Christoph M. Becker
65bbc67063 Next is 7.3.14 2019-12-03 12:04:17 +01:00
Christoph M. Becker
996f217aa5 Fix #78883: fgets(STDIN) fails on Windows
We add the `is_seekable` member to `php_stdio_stream_data`, and prefer
that over `is_pipe`, since the latter is simply a misnomer.  We keep
`is_pipe` for now for Windows only, though, because we need special
support for pipes there.  We also fix the misaligned bitfield which
formerly took 33 bit.
2019-12-02 16:52:32 +01:00
Christoph M. Becker
3356dd0575 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78814: strip_tags allows / in tag name => whitelist bypass
2019-12-02 11:39:35 +01:00
Christoph M. Becker
861fa60814 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78814: strip_tags allows / in tag name => whitelist bypass
2019-12-02 11:38:45 +01:00
Christoph M. Becker
600f1f898f Fix #78814: strip_tags allows / in tag name => whitelist bypass
When normalizing tags to check whether they are contained in the set
of allowable tags, we must not strip slashes, unless they come
immediately after the opening `<`, or immediately before the closing
`>`.
2019-12-02 11:37:25 +01:00
Christoph M. Becker
a9e45bc0fb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78296: is_file fails to detect file
2019-12-02 11:29:58 +01:00
Christoph M. Becker
bb735c9e9e Fix #78296: is_file fails to detect file
If we're constructing extended-length paths (i.e. paths prefixed with
`\\?\`), we have to replace all forward slashes with backward slashes,
because the former are not supported by Windows for extended-length
paths.

The more efficient and likely cleaner alternative solution would be to
cater to this in `php_win32_ioutil_normalize_path_w()` by always
replacing forward slashes, but that might break existing code.  It
might be sensible to change that for `master`, though.
2019-12-02 11:29:10 +01:00
Christoph M. Becker
4ff242a9a7 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78833: Integer overflow in pack causes out-of-bound access
2019-12-02 11:21:07 +01:00
Christoph M. Becker
3d81c54879 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78833: Integer overflow in pack causes out-of-bound access
2019-12-02 11:19:15 +01:00
Christoph M. Becker
db420cb6a1 Fix #78833: Integer overflow in pack causes out-of-bound access
We check for potential signed integer overflow, and bail out
gracefully, in that case.
2019-12-02 11:18:19 +01:00
Jakub Zelenka
67cd4271e9 Fix bug #78889 (php-fpm service fails to start) 2019-12-01 17:13:20 +00:00
Christoph M. Becker
1979c5d16f Upgrade to Oniguruma 6.9.4
Oniguruma 6.9.4 fixes several CVEs.
2019-11-30 14:00:41 +01:00
Christoph M. Becker
30aa2e8932 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78840: imploding $GLOBALS crashes
2019-11-27 09:33:55 +01:00
Christoph M. Becker
fee38633d2 Fix #78840: imploding $GLOBALS crashes
We add support for IS_INDIRECT zvals to implode().
2019-11-27 09:32:16 +01:00
Christoph M. Becker
717730ddd1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77638: var_export'ing certain class instances segfaults
2019-11-25 15:57:56 +01:00
Christoph M. Becker
23c65a8173 Fix #77638: var_export'ing certain class instances segfaults
If objects return immutable property hash tables (typically,
`zend_empty_array`), we must not try to apply recursion protection on
those.
2019-11-25 15:54:11 +01:00
Dmitry Stogov
2ebf530946 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value)
2019-11-25 14:09:18 +03:00
Dmitry Stogov
bb30fe9e2b Fixed bug #78868 (Calling __autoload() with incorrect EG(fake_scope) value) 2019-11-25 14:05:43 +03:00
Derick Rethans
71d42dc794 Consolidate NEWS for 7.4.0 release 2019-11-24 10:23:33 +01:00
Derick Rethans
c16cbfd1da WIP: Merge NEWS 2019-11-23 20:00:51 +01:00
Christoph M. Becker
cfb643ca2b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78853: preg_match() may return integer > 1
2019-11-22 19:29:11 +01:00
Christoph M. Becker
e1da72bdf1 Fix #78853: preg_match() may return integer > 1
Commit 54ebebd[1] optimized the match loop, but for this case it has
been overlooked, that we must only loop if we're doing global matching.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=54ebebd686255c5f124af718c966edb392782d4a>
2019-11-22 19:26:26 +01:00
Christoph M. Becker
b78ec58f09 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
2019-11-21 10:02:33 +01:00
Christoph M. Becker
b4f501d5a4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
2019-11-21 10:01:05 +01:00
Christoph M. Becker
9b92c1d154 Fix #78849: GD build broken with -D SIGNED_COMPARE_SLOW
Apparently, this has not been tested for a long time, and might be a
refactoring relict.  Anyhow, we have to pass the context to
`GIFNextPixel` as well.
2019-11-21 09:59:26 +01:00
Christoph M. Becker
bcb8ab304e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
2019-11-18 12:48:55 +01:00
Christoph M. Becker
3b46fbfc36 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
2019-11-18 12:47:53 +01:00
Christoph M. Becker
f6eac76b65 Update NEWS 2019-11-18 12:46:43 +01:00
Jakub Zelenka
29c7c9e8ed Add NEWS entry for bug #76601 fix 2019-11-17 14:52:36 +00:00
Nikita Popov
266f3a02bc Fixed bug #78810 2019-11-15 12:06:17 +01:00