]> granicus.if.org Git - php/log
php
5 years agoFix early free of assign_obj op_data
Nikita Popov [Fri, 20 Dec 2019 09:33:18 +0000 (10:33 +0100)]
Fix early free of assign_obj op_data

We need to make sure that op_data is only freed after populating
result, as op_data may be the only thing holding the value in the
case of an overloaded assignment.

This reverts the code to how it looked like in 7.3.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Dmitry Stogov [Thu, 19 Dec 2019 20:17:39 +0000 (23:17 +0300)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78999 (Cycle leak when using function result as temporary)

5 years agoFixed bug #78999 (Cycle leak when using function result as temporary)
Dmitry Stogov [Thu, 19 Dec 2019 20:11:08 +0000 (23:11 +0300)]
Fixed bug #78999 (Cycle leak when using function result as temporary)

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 19 Dec 2019 12:21:05 +0000 (13:21 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78983: pdo_pgsql config.w32 cannot find libpq-fe.h

5 years agoFix #78983: pdo_pgsql config.w32 cannot find libpq-fe.h
SATO Kentaro [Tue, 17 Dec 2019 17:47:08 +0000 (02:47 +0900)]
Fix #78983: pdo_pgsql config.w32 cannot find libpq-fe.h

When configured with a path specified.

5 years agoAvoid signed integer overflow in string offset check
Nikita Popov [Thu, 19 Dec 2019 10:46:14 +0000 (11:46 +0100)]
Avoid signed integer overflow in string offset check

Cast to size_t before performing operations instead of afterwards.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Thu, 19 Dec 2019 09:43:14 +0000 (10:43 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Add destructor annotations in ini parser

5 years agoAdd destructor annotations in ini parser
Nikita Popov [Thu, 19 Dec 2019 09:42:10 +0000 (10:42 +0100)]
Add destructor annotations in ini parser

It would be better to switch this to use %union and %type annotations,
but not going to do that change for 7.3.

5 years agoFix leak in assign_ref with function
Nikita Popov [Wed, 18 Dec 2019 16:18:10 +0000 (17:18 +0100)]
Fix leak in assign_ref with function

As far as I can see, the retval copying is already done in all
callers of this function, so it should not be duplicated here.

5 years agoFixed bug #78776
Nikita Popov [Wed, 18 Dec 2019 14:53:09 +0000 (15:53 +0100)]
Fixed bug #78776

By using the normal inheritance check if the parent is abstract
as well.

5 years agofix release date
Remi Collet [Wed, 18 Dec 2019 13:18:03 +0000 (14:18 +0100)]
fix release date

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Remi Collet [Wed, 18 Dec 2019 13:17:49 +0000 (14:17 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  fix release date
  fix release date

5 years agofix release date
Remi Collet [Wed, 18 Dec 2019 13:17:31 +0000 (14:17 +0100)]
fix release date

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Remi Collet [Wed, 18 Dec 2019 13:17:21 +0000 (14:17 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  fix release date

5 years agofix release date
Remi Collet [Wed, 18 Dec 2019 13:16:19 +0000 (14:16 +0100)]
fix release date

5 years agoFixed bug #78986
Nikita Popov [Wed, 18 Dec 2019 10:37:39 +0000 (11:37 +0100)]
Fixed bug #78986

Don't assume that handlers live in the arena, they may also be in
SHM.

5 years agoAdd CONFLICTS tag
Fabien Villepinte [Wed, 18 Dec 2019 10:08:24 +0000 (11:08 +0100)]
Add CONFLICTS tag

These tests can be the reason file_get_contents_variation8.phpt fails times to times.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 18 Dec 2019 10:04:46 +0000 (11:04 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Rethrow generator exception even without active stack frame

5 years agoRethrow generator exception even without active stack frame
Nikita Popov [Wed, 18 Dec 2019 10:02:44 +0000 (11:02 +0100)]
Rethrow generator exception even without active stack frame

Finally blocks in generators may be invoked during shutdown, in
which case we don't have a stack frame. Similar to what
zend_call_function does, we still need to rethrow these exceptions,
otherwise they will be hidden (and leak).

5 years agoFix use-after-free when trying to write to closure property
Nikita Popov [Wed, 18 Dec 2019 09:24:02 +0000 (10:24 +0100)]
Fix use-after-free when trying to write to closure property

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 18 Dec 2019 09:11:23 +0000 (10:11 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix freeing of dynamic call name

5 years agoFix freeing of dynamic call name
Nikita Popov [Wed, 18 Dec 2019 09:10:30 +0000 (10:10 +0100)]
Fix freeing of dynamic call name

We need to free op2 if the call construction fails.

Also remove a redundant check for !call.

5 years agoFix const/cv freeing on failed reference assignment
Nikita Popov [Wed, 18 Dec 2019 08:53:30 +0000 (09:53 +0100)]
Fix const/cv freeing on failed reference assignment

5 years agoMore updates to CONTRIBUTING.md
Christoph M. Becker [Tue, 17 Dec 2019 19:01:18 +0000 (20:01 +0100)]
More updates to CONTRIBUTING.md

7.4 is stable.

5 years agoUpdate CONTRIBUTING.md
Christoph M. Becker [Tue, 17 Dec 2019 18:57:49 +0000 (19:57 +0100)]
Update CONTRIBUTING.md

7.1 is EOL; 7.2 is security fixes only.

5 years agoFix #78976: SplFileObject::fputcsv returns -1 on failure
Christoph M. Becker [Tue, 17 Dec 2019 16:52:18 +0000 (17:52 +0100)]
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.

5 years agoFree buffer in php_verror even if it is empty
Nikita Popov [Tue, 17 Dec 2019 15:44:17 +0000 (16:44 +0100)]
Free buffer in php_verror even if it is empty

vspprintf allocates a buffer even if the resulting string is empty.

5 years agoFix resetting of internal_encoding and friends
Nikita Popov [Tue, 17 Dec 2019 15:26:42 +0000 (16:26 +0100)]
Fix resetting of internal_encoding and friends

We need to update the value even if new_value is NULL. In particular,
it should be reset back to NULL after each request if the setting was
not specified on startup. Otherwise we leave dangling pointers.

5 years agoAvoid float to int cast UB in exif
Nikita Popov [Tue, 17 Dec 2019 12:15:01 +0000 (13:15 +0100)]
Avoid float to int cast UB in exif

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 17 Dec 2019 09:05:18 +0000 (10:05 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Update/fix NEWS [ci skip]

5 years agoUpdate/fix NEWS [ci skip]
Christoph M. Becker [Tue, 17 Dec 2019 08:51:30 +0000 (09:51 +0100)]
Update/fix NEWS [ci skip]

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 17 Dec 2019 09:02:43 +0000 (10:02 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  [ci skip] Update NEWS
  [ci skip] Update  NEWS
  Fix test

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Christoph M. Becker [Tue, 17 Dec 2019 09:01:50 +0000 (10:01 +0100)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  [ci skip] Update  NEWS

5 years ago[ci skip] Update NEWS
Stanislav Malyshev [Tue, 17 Dec 2019 07:45:11 +0000 (23:45 -0800)]
[ci skip] Update NEWS

5 years ago[ci skip] Update NEWS
Stanislav Malyshev [Tue, 17 Dec 2019 07:41:04 +0000 (23:41 -0800)]
[ci skip] Update  NEWS

5 years agoProperty names of internal classes from temporary extensins, loaded by dl(), may...
Dmitry Stogov [Tue, 17 Dec 2019 07:10:11 +0000 (10:10 +0300)]
Property names of internal classes from temporary extensins, loaded by dl(), may be emalloc-ed strings.

5 years agoFixed memory leak
Dmitry Stogov [Tue, 17 Dec 2019 07:09:22 +0000 (10:09 +0300)]
Fixed memory leak

5 years agoFixed memory leaks
Dmitry Stogov [Tue, 17 Dec 2019 06:58:27 +0000 (09:58 +0300)]
Fixed memory leaks

5 years agoSet opcache.optimization_level=0 in test
Nikita Popov [Mon, 16 Dec 2019 19:23:17 +0000 (20:23 +0100)]
Set opcache.optimization_level=0 in test

Otherwise opcache "inlines" the function, which causes a minor
difference in destruction behavior.

5 years agoFix test
Stanislav Malyshev [Mon, 16 Dec 2019 18:32:49 +0000 (10:32 -0800)]
Fix test

5 years agoTest fixes
Stanislav Malyshev [Mon, 16 Dec 2019 18:31:22 +0000 (10:31 -0800)]
Test fixes

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Mon, 16 Dec 2019 18:05:02 +0000 (10:05 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix test
  Fix bug #78793

5 years agoMerge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4
Stanislav Malyshev [Mon, 16 Dec 2019 18:04:09 +0000 (10:04 -0800)]
Merge branch 'PHP-7.4' of git.php.net:php-src into PHP-7.4

* 'PHP-7.4' of git.php.net:php-src:
  Remove DateTime class registration test
  Fixed bug #78973
  Fixed bug #78961 (erroneous optimization of re-assigned $GLOBALS)

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Mon, 16 Dec 2019 18:04:03 +0000 (10:04 -0800)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fix test
  Fix bug #78793

5 years agoFix test
Stanislav Malyshev [Mon, 16 Dec 2019 18:03:43 +0000 (10:03 -0800)]
Fix test

5 years agoRemove DateTime class registration test
Nikita Popov [Mon, 16 Dec 2019 17:57:19 +0000 (18:57 +0100)]
Remove DateTime class registration test

This test is more annoying than useful.

5 years agoFixed bug #78973
Nikita Popov [Mon, 16 Dec 2019 17:52:30 +0000 (18:52 +0100)]
Fixed bug #78973

Save opline in leave helper to correctly handle destructor calls
during CV freeing (or other leave freeing).

5 years agoFixed bug #78961 (erroneous optimization of re-assigned $GLOBALS)
Dmitry Stogov [Mon, 16 Dec 2019 09:24:47 +0000 (12:24 +0300)]
Fixed bug #78961 (erroneous optimization of re-assigned $GLOBALS)

5 years agoFix bug #78793
Stanislav Malyshev [Mon, 16 Dec 2019 09:14:38 +0000 (01:14 -0800)]
Fix bug #78793

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Mon, 16 Dec 2019 09:11:01 +0000 (01:11 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix build - no model field anymore

5 years agoFix build - no model field anymore
Stanislav Malyshev [Mon, 16 Dec 2019 09:10:42 +0000 (01:10 -0800)]
Fix build - no model field anymore

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Stanislav Malyshev [Mon, 16 Dec 2019 08:39:37 +0000 (00:39 -0800)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78910
  Fix #78878: Buffer underflow in bc_shift_addsub
  Fix test
  Fix #78862: link() silently truncates after a null byte on Windows
  Fix #78863: DirectoryIterator class silently truncates after a null byte
  Fix #78943: mail() may release string with refcount==1 twice

5 years agoMerge branch 'PHP-7.2' into PHP-7.3
Stanislav Malyshev [Mon, 16 Dec 2019 08:38:54 +0000 (00:38 -0800)]
Merge branch 'PHP-7.2' into PHP-7.3

* PHP-7.2:
  Fixed bug #78910
  Fix #78878: Buffer underflow in bc_shift_addsub
  Fix test
  Fix #78862: link() silently truncates after a null byte on Windows
  Fix #78863: DirectoryIterator class silently truncates after a null byte

5 years agoFixed bug #78910
Stanislav Malyshev [Mon, 16 Dec 2019 08:10:39 +0000 (00:10 -0800)]
Fixed bug #78910

5 years agoFix #78878: Buffer underflow in bc_shift_addsub
Christoph M. Becker [Sat, 30 Nov 2019 11:26:37 +0000 (12:26 +0100)]
Fix #78878: Buffer underflow in bc_shift_addsub

We must not rely on `isdigit()` to detect digits, since we only support
decimal ASCII digits in the following processing.

5 years agoFix test
Stanislav Malyshev [Sat, 30 Nov 2019 23:37:28 +0000 (15:37 -0800)]
Fix test

5 years agoFix #78862: link() silently truncates after a null byte on Windows
Christoph M. Becker [Sat, 23 Nov 2019 12:01:33 +0000 (13:01 +0100)]
Fix #78862: link() silently truncates after a null byte on Windows

Since link() is supposed to accepts paths (i.e. strings without NUL
bytes), we must not accept arbitrary strings.

5 years agoFix #78863: DirectoryIterator class silently truncates after a null byte
Christoph M. Becker [Mon, 25 Nov 2019 15:56:34 +0000 (16:56 +0100)]
Fix #78863: DirectoryIterator class silently truncates after a null byte

Since the constructor of DirectoryIterator and friends is supposed to
accepts paths (i.e. strings without NUL bytes), we must not accept
arbitrary strings.

5 years agoFix #78943: mail() may release string with refcount==1 twice
Christoph M. Becker [Tue, 10 Dec 2019 17:43:01 +0000 (18:43 +0100)]
Fix #78943: mail() may release string with refcount==1 twice

Since we need `headers_lc` as well as `headers_trim` in the following,
we do not release the former even if they are the same string, to avoid
complicating the release logic even more.

A new test case is not necessary, since we already have
mail_basic_alt2-win32.phpt and others.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 13 Dec 2019 15:38:24 +0000 (16:38 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #78921

5 years agoFixed bug #78921
Nikita Popov [Fri, 13 Dec 2019 15:37:20 +0000 (16:37 +0100)]
Fixed bug #78921

By resetting fake_scope during autoloading. We already do the same
when executing destructors.

5 years agoIntroduce extra counter to avoid RTD key collisions
Nikita Popov [Wed, 11 Dec 2019 16:11:30 +0000 (17:11 +0100)]
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.

5 years agoFix #78929: plus signs in cookie values are converted to spaces
Kachalin Alexey [Thu, 12 Dec 2019 10:49:06 +0000 (11:49 +0100)]
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.

5 years agoFixed bug #78950: Preloading trait method with static variables
Nikita Popov [Thu, 12 Dec 2019 10:19:07 +0000 (11:19 +0100)]
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.

5 years agoFix handling of non-final loop var free in sccp
Nikita Popov [Thu, 12 Dec 2019 08:39:52 +0000 (09:39 +0100)]
Fix handling of non-final loop var free in sccp

We only need to preserve the FE_FREE that marks the end of the
loop range. Skip FE_FREEs with the FREE_ON_RETURN flag.

5 years agouint/ulong removal may affect other platforms as well
Christoph M. Becker [Wed, 11 Dec 2019 22:44:46 +0000 (23:44 +0100)]
uint/ulong removal may affect other platforms as well

5 years agoTypo fix in php.ini-production
Adrian Verde [Wed, 11 Dec 2019 20:51:05 +0000 (21:51 +0100)]
Typo fix in php.ini-production

Possibe -> Possible

5 years agoRevert "Fixed bug #78903: Conflict in RTD key for closures results in crash"
Nikita Popov [Wed, 11 Dec 2019 13:38:48 +0000 (14:38 +0100)]
Revert "Fixed bug #78903: Conflict in RTD key for closures results in crash"

This reverts commit b55033fa18afd9bb60fc4537270266d808ec0868.

This breaks ext/opcache/tests/bug65915.phpt.

5 years agoFixed bug #78903: Conflict in RTD key for closures results in crash
Nikita Popov [Wed, 11 Dec 2019 12:06:10 +0000 (13:06 +0100)]
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.

5 years agoFree RSA public key in mysqlnd sha256 auth
Nikita Popov [Wed, 11 Dec 2019 09:30:19 +0000 (10:30 +0100)]
Free RSA public key in mysqlnd sha256 auth

Not sure why this only started showing up as a leak now.

5 years agoAddirional fix for bug #78918
Dmitry Stogov [Wed, 11 Dec 2019 09:21:49 +0000 (12:21 +0300)]
Addirional fix for bug #78918

5 years agoFixed bug #78937 (Preloading unlinkable anonymous class can segfault)
Dmitry Stogov [Tue, 10 Dec 2019 21:46:30 +0000 (00:46 +0300)]
Fixed bug #78937 (Preloading unlinkable anonymous class can segfault)

5 years agoFix error message
Dmitry Stogov [Tue, 10 Dec 2019 19:17:10 +0000 (22:17 +0300)]
Fix error message

5 years agoPHP-7.4 is now 7.4.2-dev
Derick Rethans [Tue, 10 Dec 2019 16:55:36 +0000 (16:55 +0000)]
PHP-7.4 is now 7.4.2-dev

5 years agoSet zend.exception_ignore_args=0 in run-tests.php
Nikita Popov [Tue, 10 Dec 2019 15:15:26 +0000 (16:15 +0100)]
Set zend.exception_ignore_args=0 in run-tests.php

Any existing tests are going to be written under this assumption...

5 years agoFix incorrect zend_try usage
Nikita Popov [Tue, 10 Dec 2019 14:22:31 +0000 (15:22 +0100)]
Fix incorrect zend_try usage

5 years agoFix release build failure
Nikita Popov [Tue, 10 Dec 2019 12:49:40 +0000 (13:49 +0100)]
Fix release build failure

GCC complained about potentially uninitialized __orig_bailout,
even though the variable has an initializer. This warning was
quite persistent, I was only able to avoid it by using a separate
function.

Am I missing something?

5 years agoImprove error message
Christoph M. Becker [Tue, 10 Dec 2019 11:46:45 +0000 (12:46 +0100)]
Improve error message

Formerly, the error message was like:

| Can't preload unlinked class MyException: Internal parent (Windows
| only limitation)Exception

Now it's like:

| Can't preload unlinked class MyException: Windows can't link to
| internal parent Exception

5 years agoAdd support for class_alias to preloading
Nikita Popov [Tue, 10 Dec 2019 10:55:14 +0000 (11:55 +0100)]
Add support for class_alias to preloading

Related to bug #78918.

5 years agoFixed bug #78935: Check that all linked classes can be preloaded
Nikita Popov [Mon, 9 Dec 2019 14:14:39 +0000 (15:14 +0100)]
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.

5 years agoFix merge mistake
Nikita Popov [Tue, 10 Dec 2019 08:03:44 +0000 (09:03 +0100)]
Fix merge mistake

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Tue, 10 Dec 2019 08:01:18 +0000 (09:01 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix DCE with FE_FETCH

5 years agoFix DCE with FE_FETCH
Nikita Popov [Tue, 10 Dec 2019 08:00:09 +0000 (09:00 +0100)]
Fix DCE with FE_FETCH

For now, don't treat FE_FETCH op2 as no-val use. See GH-4982.

5 years agoFix #78912: INTL Support for accounting format
Christoph M. Becker [Fri, 6 Dec 2019 11:41:41 +0000 (12:41 +0100)]
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>

5 years agoFix build
Nikita Popov [Mon, 9 Dec 2019 15:06:26 +0000 (16:06 +0100)]
Fix build

5 years agoExport zend_init_func_run_time_cache()
Dmitry Stogov [Mon, 9 Dec 2019 12:58:00 +0000 (15:58 +0300)]
Export zend_init_func_run_time_cache()

5 years agoCall zend_unregister_ini_entries() when unload extension loaded through dl() without...
Dmitry Stogov [Mon, 9 Dec 2019 12:05:24 +0000 (15:05 +0300)]
Call zend_unregister_ini_entries() when unload extension loaded through dl() without MSHUTDOWN callback.
Extensions with MSHUTDOWN should use UNREGISTER_INI_ENTRIES().

5 years agoFixed bug #78895 (Reflection detects abstract non-static class as abstract static...
Dmitry Stogov [Mon, 9 Dec 2019 10:49:12 +0000 (13:49 +0300)]
Fixed bug #78895 (Reflection detects abstract non-static class as abstract static. IS_IMPLICIT_ABSTRACT is not longer used)

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 9 Dec 2019 09:32:03 +0000 (10:32 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Extend CURLFile to support streams
  Use curl_mime_*() functions if available

5 years agoExtend CURLFile to support streams
Christoph M. Becker [Mon, 29 Apr 2019 08:21:07 +0000 (10:21 +0200)]
Extend CURLFile to support streams

Due to former restrictions of the libcurl API, curl multipart/formdata
file uploads supported only proper files.  However, as of curl 7.56.0
the new `curl_mime_*()` API is available (and already supported by
PHP[1]), which allows us to support arbitrary *seekable* streams, which
is generally desirable, and particularly resolves issues with the
transparent Unicode and long part support on Windows (see bug #77711).

Note that older curl versions are still supported, but CURLFile is
still restricted to proper files in this case.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=a83b68ba56714bfa06737a61af795460caa4a105>

(cherry picked from commit c68dc6b5e37e74d89e0a387079139c054c8faa81)

5 years agoUse curl_mime_*() functions if available
Christoph M. Becker [Mon, 15 Apr 2019 16:24:59 +0000 (18:24 +0200)]
Use curl_mime_*() functions if available

As of curl 7.56.0, `curl_formadd()` is deprecated in favor of
`curl_mime_*()`, so we use the latter if available.

(cherry picked from commit a83b68ba56714bfa06737a61af795460caa4a105)

5 years agoFixed bug #78926: Handle class table reallocation on failed link
Nikita Popov [Mon, 9 Dec 2019 08:15:27 +0000 (09:15 +0100)]
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.

5 years agoFix bug #78887: Add upgrading note about get_declared_classes() order
Nikita Popov [Mon, 9 Dec 2019 07:58:11 +0000 (08:58 +0100)]
Fix bug #78887: Add upgrading note about get_declared_classes() order

[ci skip]

5 years agoUse unmangled named in property type inheritance error
Nikita Popov [Mon, 9 Dec 2019 07:48:33 +0000 (08:48 +0100)]
Use unmangled named in property type inheritance error

5 years agoFixed bug #78904: Don't call any magic for uninitialized typed properties
Nikita Popov [Mon, 28 Oct 2019 12:34:33 +0000 (13:34 +0100)]
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.

5 years agoFix bug #78916 (php-fpm 7.4.0 don't send mail via mail())
Jakub Zelenka [Sun, 8 Dec 2019 17:57:17 +0000 (17:57 +0000)]
Fix bug #78916 (php-fpm 7.4.0 don't send mail via mail())

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Sat, 7 Dec 2019 11:07:51 +0000 (12:07 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78923: Artifacts when convoluting image with transparency

5 years agoFix #78923: Artifacts when convoluting image with transparency
willson-chen [Sat, 7 Dec 2019 02:56:37 +0000 (10:56 +0800)]
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>.

5 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 6 Dec 2019 10:10:31 +0000 (11:10 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix constant evaluation of && and ||

5 years agoFix constant evaluation of && and ||
Nikita Popov [Fri, 6 Dec 2019 10:07:57 +0000 (11:07 +0100)]
Fix constant evaluation of && and ||

The "return" in the for loop should have been a break on the switch,
otherwise the result is just ignored... but because it prevents
evaluation of the other operand, it also violates the invariant that
everything has been constant evaluated, resulting in an assertion
failure.

The for loop isn't correct in any case though, because it's not legal
to determine the result based on just the second operand, as the
first one may have a side-effect that cannot be optimized away.