Commit Graph

12646 Commits

Author SHA1 Message Date
Nikita Popov
3b7c8bb973 Fix bug #80126
When performing an unlinked instanceof, we also need to consider
interfaces of parent classes, as they may not have been inherited
yet.
2020-10-06 16:33:14 +02:00
Christoph M. Becker
c6e7969f05 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #46050: odbc_next_result corrupts prepared resource
2020-10-05 17:47:35 +02:00
Christoph M. Becker
69ba81d183 Fix #46050: odbc_next_result corrupts prepared resource
When resetting the result's values, we also have to reset its numcols.
2020-10-05 17:46:37 +02:00
Matteo Beccati
7c48479f62 [ci skip] moved soap fix to 7.4.11
When committing I didn't notice that version had been just bumped
2020-10-02 09:33:50 +02:00
Matteo Beccati
1666cfcca0 [ci skip] moved soap fix to 7.3.23
When committing I didn't notice that version had been just bumped
2020-10-02 09:32:52 +02:00
Stanislav Malyshev
f20a2b4f3c [ci skip] Add 7.4.11 security fixes to NEWS 2020-09-29 10:13:38 -07:00
Stanislav Malyshev
ae95d06f68 [ci skip] Add 7.3.23 security fixes to NEWS 2020-09-29 10:09:33 -07:00
Christoph M. Becker
b87e43d931 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80152: odbc_execute() moves internal pointer of $params
2020-09-29 11:35:41 +02:00
Christoph M. Becker
bf5f07cc8b Fix #80152: odbc_execute() moves internal pointer of $params
As least intrusive fix, we separate the passed array argument.

Closes GH-6219.
2020-09-29 11:34:48 +02:00
Christoph M. Becker
e08f69194c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80150: Failure to fetch error message
2020-09-29 11:04:09 +02:00
Christoph M. Becker
df5efa2fcd Fix #80150: Failure to fetch error message
In case of statement related errors, we need to pass the respective
statement handle to `SQLError()`.

Closes GH-6217.
2020-09-29 11:02:51 +02:00
Christoph M. Becker
f1d8395c77 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #67465: NULL Pointer dereference in odbc_handle_preparer
2020-09-28 22:58:16 +02:00
Christoph M. Becker
6acfb79276 Fix #67465: NULL Pointer dereference in odbc_handle_preparer
We have to initialize `stmt->driver_data` before we use it.

Closes GH-6225.
2020-09-28 22:57:01 +02:00
Christoph M. Becker
1086e4ec88 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80147: BINARY strings may not be properly zero-terminated
2020-09-25 13:52:08 +02:00
Christoph M. Becker
a49555a9e1 Fix #80147: BINARY strings may not be properly zero-terminated
We have to manually ensure that all strings fetched from a data source
are zero-terminated.

Closes GH-6213.
2020-09-25 13:51:18 +02:00
Christoph M. Becker
901d022001 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78470: odbc_specialcolumns() no longer accepts $nullable
2020-09-24 12:16:54 +02:00
Christoph M. Becker
610e7d2c77 Fix #78470: odbc_specialcolumns() no longer accepts $nullable
It is mandatory to pass either `SQL_NO_NULLS` or `SQL_NULLABLE` as
tenth parameter to `SQLSpecialColumns()`; otherwise the function call
fails.  Therefore the user must be allowed to pass the desired value
as parameter to `odbc_specialcolumns()` again.

Closes GH-6200.
2020-09-24 12:15:59 +02:00
Christoph M. Becker
a89ac98f15 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #76735: Incorrect message in fopen on invalid mode
2020-09-23 10:54:59 +02:00
Christoph M. Becker
2576c57a51 Fix #76735: Incorrect message in fopen on invalid mode
We have to log errors in `stream_opener` callbacks to the wrapper's
error log, because otherwise we may pick up an unrelated `errno` or a
most generic message.

Closes GH-6187.
2020-09-23 10:54:06 +02:00
Christoph M. Becker
ff0f6c26c2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #76943: Inconsistent stream_wrapper_restore() errors
2020-09-22 16:12:37 +02:00
Christoph M. Becker
5ed0602ec6 Fix #76943: Inconsistent stream_wrapper_restore() errors
If restoring of any not registered built-in wrapper is requested, the
function is supposed to fail with a warning, so we have to check this
condition first.

Furthermore, to be able to detect whether a built-in wrapper has been
changed, it is not sufficient to check whether *any* userland wrapper
has been registered, but rather whether the specific wrapper has been
modified.

Closes GH-6183.
2020-09-22 16:11:35 +02:00
Christoph M. Becker
f445e9cb93 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79423: copy command is limited to size of file it can copy
2020-09-22 13:16:59 +02:00
Christoph M. Becker
4000780b3d Fix #79423: copy command is limited to size of file it can copy
Passing `NULL` as `lpFileSizeHigh` to `GetFileSize()` gives wrong
results for files larger than 0xFFFFFFFF bytes.  We fix this by using
`GetFileSizeEx()`, and let the mapping fail, if the file size is too
large for the architecture.

Closes GH-5319.
2020-09-22 13:15:07 +02:00
Christoph M. Becker
19c844594e Fix mmap copying
Instead of attempting to map large files into memory at once, we map
chunks of at most `PHP_STREAM_MMAP_MAX` bytes, and repeat that until we
hit the point where `php_stream_seek()` fails (see bug 54902), and copy
the rest of the file by reading and writing small chunks.

We also fix the mapping behavior for zero bytes on Windows, which did
not error (as with `mmap()`), but would have mapped the remaining file.
2020-09-21 16:07:57 +02:00
Christoph M. Becker
d27dc5c028 Fix #80118: Erroneous whitespace match with JIT only
We backport r1273[1] from PCRE2.

[1] <https://vcs.pcre.org/pcre2?revision=1273&view=revision>

Closes GH-6165.
2020-09-21 10:28:22 +02:00
Christoph M. Becker
105132bd6b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80114: parse_url does not accept URLs with port 0
2020-09-20 15:37:11 +02:00
Christoph M. Becker
81b2f3e5d9 Fix #80114: parse_url does not accept URLs with port 0
URIs with a 0 port are generally valid, so `parse_url()` should
recognize such URIs, but still report the port as missing.

Co-authored-by: twosee <twose@qq.com>

Closes GH-6152.
2020-09-20 15:34:45 +02:00
Nikita Popov
5e7c5a82a5 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #80107: Handling of large compressed packets
  Bug #80107 Add test for mysqli_query() fails for ~16 MB long query when compression is enabled
2020-09-18 12:57:50 +02:00
Nikita Popov
ecd9c42f9e Fix bug #80107: Handling of large compressed packets
There's two layers of packet splitting going on. First, packets
need to be split into having a payload of exactly 2^24-1 bytes or
being the last packet. If the split packet has size between 2^24-5
and 2^24-1 bytes, the compressed packets also needs to be split,
though the choice of split doesn't matter here. I'm splitting off
the first 8192 bytes, as that's what I observe libmysqlclient to be
doing.
2020-09-18 12:55:44 +02:00
Christoph M. Becker
9f2d03952d Update to PCRE2 10.35
We also backport the fix for bug #79846, and add a test case for the
related bug #79363.
2020-09-17 14:07:05 +02:00
Christoph M. Becker
c3c76dbfb9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80115: mysqlnd.debug doesn't recognize absolute paths with slashes
2020-09-17 12:38:16 +02:00
Christoph M. Becker
efdbc3688b Fix #80115: mysqlnd.debug doesn't recognize absolute paths with slashes 2020-09-17 12:37:02 +02:00
Nikita Popov
9c136f10cd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80083
2020-09-17 10:13:53 +02:00
Nikita Popov
a4f806aa79 Fixed bug #80083
Add db2_execute() to the list of functions accessing the local
scope. Ideally the API wouldn't do that, but it seems most
pragmatic to address this on the opcache side at this point.
2020-09-17 10:12:10 +02:00
Christoph M. Becker
edddddcea8 7.3.24 is next 2020-09-15 10:51:41 +02:00
Derick Rethans
4e794b7935 The next release here will be 7.4.12 2020-09-15 09:36:57 +01:00
Christoph M. Becker
e41867888a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80067: Omitting the port in bindto setting errors
2020-09-11 14:46:51 +02:00
Christoph M. Becker
dfb3a79914 Fix #80067: Omitting the port in bindto setting errors
A recent commit[1] which fixed a memory leak introduced a regression
regarding the formerly liberal handling of IP addresses to bind to.  We
fix this by reverting that commit, and fix the memory leak where it
actually occurs.  In other words, this fix is less intrusive than the
former fix.

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

Closes GH-6104.
2020-09-11 14:44:12 +02:00
Sammy Kaye Powers
1b5268265c
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79825: opcache.file_cache causes SIGSEGV with custom opcode handlers
2020-09-09 12:36:51 -07:00
Sammy Kaye Powers
2d4aa1ef3d
Fix #79825: opcache.file_cache causes SIGSEGV with custom opcode handlers
Modules may have changed after restart which can cause dangling pointers from custom opcode handlers in the second-level cache files. This fix includes the installed module names and versions in the accel_system_id hash as entropy. Closes GH-5836
2020-09-09 12:08:19 -07:00
Christoph M. Becker
e6b2a97cac Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #72941: Modifying bucket->data by-ref has no effect any longer
2020-09-08 18:08:38 +02:00
Christoph M. Becker
5dcb8f2f1c Fix #72941: Modifying bucket->data by-ref has no effect any longer
To match the PHP 5 behavior, we have to explicitly cater to `buffer` or
`data` being references.

Closes GH-6096.
2020-09-08 18:06:40 +02:00
Nikita Popov
d0d9c3a980 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80077
2020-09-08 10:01:13 +02:00
Nikita Popov
07cb665515 Fixed bug #80077
Quoting from the bug report:

> The domain names passed to getmxrr() do not contain a trailing dot.
> DNS lookups which do not find records will (depending on the local
> resolver config) try again by adding the local domain to the end of
> the searched host/domain. In many environments there's an mx record
> for any subdomain of the local domain and the MX query will return
> a hit. But the test expects no hit. So the test fails when checking
> that "qa.php.net" does not have an MX record in DNS. In our local
> environment the resolver falls back to also check qa.php.net.kippdata.de
> which does have an MX record. Using "qa.php.net." instead of "qa.php.net"
> should fix this for everyone.
2020-09-08 10:00:49 +02:00
Nikita Popov
2dabc4c305 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #80049
2020-09-03 17:12:58 +02:00
Nikita Popov
46a49be6c8 Fixed bug #80049
Type checking may convert to refcounted values, so force freeing
of extra args.
2020-09-03 17:12:40 +02:00
Christoph M. Becker
2f4a2a9316 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80048: Bug #69100 has not been fixed for Windows
2020-09-03 15:45:33 +02:00
Christoph M. Becker
1848ccdae2 Fix #80048: Bug #69100 has not been fixed for Windows
We fix the erroneous length calculation on Windows, too.

Closes GH-6067.
2020-09-03 15:43:19 +02:00
Nikita Popov
8516434a56 Fixed bug #80046
We already protect against optimizing away loop frees in DFA pass,
but not in block pass.
2020-09-03 11:19:04 +02:00
Nikita Popov
dfaa4768d2 Fix bug #80037
If we're accessing an uninitialized typed property and __get is
defined, don't perform a read_property callback, as __get is
supposed to have no effect on uninitialized typed properties.
Usually it doesn't, but by-reference assignments cannot be
performed through read_property.

I'm deleting the test for bug #80039 again, as it doesn't really
make sense anymore with this fix.
2020-08-31 12:17:00 +02:00
Matteo Beccati
42b6b8a3ae Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80027 Terrible performance using $query->fetch on queries with many bind parameters
2020-08-31 11:08:26 +02:00
Matteo Beccati
44ade0e875 Fix #80027 Terrible performance using $query->fetch on queries with many bind parameters
Added new flags that allow skipping param_evt(s) that are not used by drivers,
in a backwards and forward compatible manner. Updated the pgsql, mysql, sqlite
and oci drivers to properly use the new flags. I've left out pdo_dblib, which
doesn't have a param_hook, and pdo_firebird, which seems to be using
PARAM_EVT_NORMALIZE in a wrong context (param type vs event type).
2020-08-31 11:03:03 +02:00
Christoph M. Becker
1ff981d7a6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #64130: COM obj parameters passed by reference are not updated
2020-08-26 14:53:46 +02:00
Christoph M. Becker
5ff15e2651 Fix #64130: COM obj parameters passed by reference are not updated
`ITypeInfo_GetIDsOfNames()` is supposed to fail with `E_NOTIMPL` for
out-of-process servers, thus we should not remove the already available
typeinfo of the object in this case.

We also properly free the `byref_vals`.
2020-08-26 14:50:04 +02:00
Christoph M. Becker
6b6c2c003c Fix #79979: passing value to by-ref param via CUFA crashes
If a by-val send is not allowed, we must not do so.  Instead we wrap
the value in a temporary reference.

Closes GH-6000
2020-08-24 14:08:32 +02:00
Christoph M. Becker
5ab7b30cd6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79986: str_ireplace bug with diacritics characters
2020-08-24 11:09:38 +02:00
Christoph M. Becker
844a2dd6ac Fix #79986: str_ireplace bug with diacritics characters
`tolower()` returns an `int`, so we must not convert to `char` which
may be `signed` and as such may be subject to overflow (actually,
implementation defined behavior).

Closes GH-6007
2020-08-24 11:08:48 +02:00
Christoph M. Becker
10df94dd0e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80002: calc free space for new interned string is wrong
2020-08-24 11:04:03 +02:00
Christoph M. Becker
fcd26ffcc3 Fix #80002: calc free space for new interned string is wrong
We need to calculate the free size in bytes.

Patch contributed by t-matsuno.

Closes GH-6024
2020-08-24 11:03:19 +02:00
Christoph M. Becker
81fffa86b2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80007: Potential type confusion in unixtojd() parameter parsing
2020-08-22 12:31:07 +02:00
Andy Postnikov
b2a33ab06b Fix #80007: Potential type confusion in unixtojd() parameter parsing
Also it fixes test on 32-bit armv7 and x86
- Test unixtojd() function : error conditions [ext/calendar/tests/unixtojd_error1.phpt]

Closes GH-6033
2020-08-22 12:30:04 +02:00
Matteo Beccati
3877172411 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #47021: SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked"
2020-08-18 18:27:26 +02:00
Matteo Beccati
f7c43b8c72 Fix #47021: SoapClient stumbles over WSDL delivered with "Transfer-Encoding: chunked" 2020-08-18 18:10:39 +02:00
Christoph M. Becker
ff14b7adad 7.3.23 is next 2020-08-18 09:55:37 +02:00
Derick Rethans
499bf91cd0 Prepare for 7.4.11 2020-08-18 08:06:20 +01:00
Nikita Popov
8bda799d6f Fixed bug #79724 2020-08-13 17:25:51 +02:00
Nikita Popov
981af26d7b Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
2020-08-11 17:13:28 +02:00
Ahmed Abdou
2fe2e5b48f Fix #64705 errorInfo property of PDOException is null when PDO::__construct() fails
PDO driver constructors are throwing PdoException without setting
errorInfo, so create a new reusable function that throws exceptions
for PDO and will also set the errorInfo. Use this function in
pdo_mysql, pdo_sqlite, and pdo_pgsql.
2020-08-11 17:12:48 +02:00
Nikita Popov
5c5508698d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #75785 by attempt switching endianness on Maker's Note
2020-08-11 16:27:06 +02:00
Nawarian
2fa4ca95db Fix bug #75785 by attempt switching endianness on Maker's Note
Different manufacturer models may come with a
different endianness (motorola/intel) format. In
order to avoid a big refactor and a gigantic lookup
table, this commit simply attempts to switch the
endianness and proceed when values are acceptable.

Closes GH-5849.
2020-08-11 16:26:34 +02:00
Nikita Popov
4609ded082 Fixed bug #79917
op_arrays can be shared on two levels: Either the op_array is
completely shared, or it is distinct but shares all members
(apart from static_variables).

The the op_array is distinct, we need to make sure to properly
initialize the MAP_PTR structures.
2020-08-11 14:58:54 +02:00
Christoph M. Becker
183b853dc6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #48585: com_load_typelib holds reference, fails on second call
2020-08-11 11:28:07 +02:00
Christoph M. Becker
dc108feab8 Fix #48585: com_load_typelib holds reference, fails on second call
Whether the type library is cached is actually irrelevant here; what
matters is that the symbols are imported, and since these are not
cached, we have to import them for every request.  And we cannot cache
the symbols, because the import depends on the current codepage, but
the codepage is a `PHP_INI_ALL` setting.
2020-08-11 11:26:50 +02:00
Nikita Popov
66d9f4d985 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79951
2020-08-11 10:35:25 +02:00
Nikita Popov
9d9dffe60a Fixed bug #79951
One branch did not release tmp_replace_entry_str.

Also reduce the scope of some variables.
2020-08-11 10:33:59 +02:00
Nikita Popov
5b8b480d23 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #79944
2020-08-10 20:43:13 +02:00
Nikita Popov
a06eed0c0e Fix bug #79944
Only return true from dns_get_mx if we actually found any MX record.
2020-08-10 20:42:50 +02:00
Christoph M. Becker
2830c3ef52 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79922: Crash after multiple calls to xml_parser_free()
2020-08-10 12:25:26 +02:00
Christoph M. Becker
0af3f49312 Fix #79922: Crash after multiple calls to xml_parser_free()
We must not call `zend_list_delete()` in resource closer functions
exposed to userland, because decreasing the refcount there leads to
use-after-free scenarios.  In this case, commit 4a42fbb worked for
typical use-cases where `xml_parser_free()` has been called exactly
once for the resource, because there is an internal zval (`->index`)
referencing the same resource which already increased the refcount by
one.  However, when `xml_parser_free()` is called multiple times on the
same XML parser resource, the resource would be freed prematurely.

Instead we forcefully close the resource in `xml_parser_free()`.  We
also could decrease the refcount of the resource there, but that would
require to call `xml_parser_free()` which is somewhat uncommon, and
would be particularly bad wrt. PHP 8 where that function is a NOP, and
as such doesn't have to be called.  So we do no longer increase the
refcount of the resource when copying it to the internal zval, and let
the usualy refcounting semantics take care of the resource destruction.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=4a42fbbbc73aad7427aef5c89974d1833636e082>
2020-08-10 12:23:44 +02:00
Nikita Popov
2d087210eb Fixed bug #79947
Move the FREE_OP for op_data out of the zend_binary_assign_op_dim_slow()
slow path, so it can be used by the other error path as well. This
makes ASSIGN_DIM_OP structurally more similar to ASSIGN_DIM.
2020-08-10 10:11:56 +02:00
Nikita Popov
fab2c3ba86 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #70574: Move files to proper locale dir
2020-08-07 14:37:43 +02:00
Florian Engelhardt
5be670265b Fix bug #70574: Move files to proper locale dir
Closes GH-5940.
2020-08-07 14:37:27 +02:00
Nikita Popov
2cbc94097e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79934: CRLF-only line in heredoc causes parsing error
2020-08-06 12:03:57 +02:00
Pieter van den Ham
06ade15528 Fix #79934: CRLF-only line in heredoc causes parsing error
Fixes the function `next_newline()` in zend_language_scanner.l. The
function now correctly returns a newline_len of 2 for "\r\n".

Closes GH-5944.
2020-08-06 12:02:54 +02:00
Nikita Popov
6bf8ff6d97 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79930
2020-08-05 15:44:00 +02:00
Nikita Popov
da786a22af Fixed bug #79930
We're inserting src_zval, so that's what we should addref.
2020-08-05 15:43:41 +02:00
Christoph M. Becker
c4677af67e [ci skip] Fix 7.3.21 release date 2020-08-04 12:31:24 +02:00
Christoph M. Becker
6f0c3386d4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Add missing NEWS entries
2020-08-03 11:19:44 +02:00
Christoph M. Becker
17d64af186 [ci skip] Add missing NEWS entries 2020-08-03 11:18:18 +02:00
Christoph M. Becker
fce8061ede Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79919: Stack use-after-scope in define()
2020-07-31 10:57:02 +02:00
Christoph M. Becker
1e0bc6e30f Fix #79919: Stack use-after-scope in define()
Instead of the temporary `rv`, we use the `val_free` which is there for
this purpose.
2020-07-31 10:54:41 +02:00
Christoph M. Becker
2bcc419800 Fix #73060: php failed with error after temp folder cleaned up
Instead of storing the mapping base address and the address of
`execute_ex()` in a separate file in the temporary folder, we store
them right at the beginning of the memory mapping.
2020-07-29 18:21:05 +02:00
Christoph M. Becker
826b90a5f0 Revert "Merge branch 'PHP-7.3' into PHP-7.4"
This reverts commit e1f6ab3388, reversing
changes made to e0ebe56ebf.

There are obviously issues with running tests in parallel, maybe
related to the cache ID.  This needs to be investigated.  Revert for
now.
2020-07-29 13:32:59 +02:00
Nikita Popov
678f5b6068 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79895: support = in PHP_CHECK_GCC_ARG m4 macro
2020-07-29 12:39:30 +02:00
Santiago M. Mola
e767ca60a0 Fix #79895: support = in PHP_CHECK_GCC_ARG m4 macro
Closes GH-5890.
2020-07-29 12:36:52 +02:00
Christoph M. Becker
e1f6ab3388 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #73060: php failed with error after temp folder cleaned up
2020-07-29 10:11:29 +02:00
Christoph M. Becker
9a744c66e7 Fix #73060: php failed with error after temp folder cleaned up
Instead of storing the mapping base address and the address of
`execute_ex()` in a separate file in the temporary folder, we store
them right at the beginning of the memory mapping.
2020-07-29 10:07:23 +02:00
Christoph M. Becker
e0ebe56ebf Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79806: realpath() erroneously resolves link to link
2020-07-28 14:00:52 +02:00
Christoph M. Becker
c756f82c02 Fix #79806: realpath() erroneously resolves link to link
After resolving reparse points, the path still may be a reparse point;
in that case we have to resolve that reparse point as well.
2020-07-28 13:55:22 +02:00
Côme Chilliet
1ba88355d7 Updated NEWS 2020-07-28 10:28:31 +02:00
Paweł Tomulik
efe6d96b45 fix memory leaks in ext/ldap/ldap.c 2020-07-28 10:23:10 +02:00
Christoph M. Becker
f02507469d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Fix #79806: realpath() erroneously resolves link to link"
2020-07-27 17:51:56 +02:00
Christoph M. Becker
1aeff522b8 Revert "Fix #79806: realpath() erroneously resolves link to link"
This reverts commit d5b59b4303.
2020-07-27 17:50:41 +02:00
Christoph M. Becker
85a26fef11 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79806: realpath() erroneously resolves link to link
2020-07-27 15:10:22 +02:00
Christoph M. Becker
d5b59b4303 Fix #79806: realpath() erroneously resolves link to link
After resolving reparse points, the path still may be a reparse point;
in that case we have to resolve that reparse point as well.
2020-07-27 15:08:39 +02:00
Christoph M. Becker
68aa1329eb Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77932: File extensions are case-sensitive
2020-07-27 11:54:54 +02:00
Christoph M. Becker
6f18d7e2f9 Fix #77932: File extensions are case-sensitive
The file extension to mime type mapping *must* not depend on the file
extension's case for case-insensitive file systems, and *should* not
for case-sensitive file systems.
2020-07-27 11:52:18 +02:00
Christoph M. Becker
3deb6b555a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79884: PHP_CONFIG_FILE_PATH is meaningless
2020-07-23 15:41:20 +02:00
Christoph M. Becker
15efb96d4c Fix #79884: PHP_CONFIG_FILE_PATH is meaningless
It does not make sense to make assumptions about `PHP_CONFIG_FILE_PATH`
during build time, since that value is never used during run time on
Windows.  Since there is no `--with-config-file-path` on Windows
either, we define `PHP_CONFIG_FILE_PATH` as `""`.
2020-07-23 15:39:22 +02:00
Nikita Popov
657a832a77 Fixed bug #79881 2020-07-22 10:21:24 +02:00
Derick Rethans
973be68c63 Prepare for 7.4.10 2020-07-21 09:23:51 +01:00
Christoph M. Becker
2c0a6977dd 7.3 is now 7.3.22-dev 2020-07-21 09:18:07 +02:00
Christoph M. Becker
4b96a75ffd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #63527: DCOM does not work with Username, Password parameter
2020-07-20 14:44:18 +02:00
Christoph M. Becker
b2e3fd1e69 Fix #63527: DCOM does not work with Username, Password parameter
We must not mix multibyte and wide character strings in the
`COAUTHIDENTITY` structure.  Using wide character strings throughout
would have the advantage that the remote connection can be established
regardless of the code page of the server, but that would more likely
break BC, so we just drop the wide character string conversion of the
username.
2020-07-20 14:43:29 +02:00
Nikita Popov
0c28b47154 Fixed bug #79839
Add reference type sources in array_walk.
2020-07-17 14:50:22 +02:00
Remi Collet
6ffe08d131 #79657 was cherry-picked in 7.4.7 2020-07-16 12:05:45 +02:00
Nikita Popov
2053329b1a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78008: dns_check_record() always return true on Alpine
2020-07-15 15:10:40 +02:00
Andy Postnikov
2c57378bd3 Fix bug #78008: dns_check_record() always return true on Alpine
- free handle before return result
- cleaned up remaining usage of MAXPACKET
- update dns_get_mx() to use the same approach

Closes GH-5854.
2020-07-15 15:10:19 +02:00
Nikita Popov
e8430b592f Fixed bug #79862
While normally a private property in the active scope would take
priority, we should not use this if it has the wrong "staticness".
2020-07-15 14:59:55 +02:00
Christopher Broadbent
ee7c7a8e26 Fixed bug #79820
Similar to what is done for ReflectionType itself, copy the
type name stored inside ReflectionProperty. Also make sure the
type field is always initialized for dynamic properties.

This is a non-issue in PHP 8, because we store a pointer to the
property_info there, rather than a copy.
2020-07-15 10:58:56 +02:00
Nikita Popov
a72c53a070 Fixed bug #79817
Use *_IND macros in a few places in string.c.
2020-07-10 14:06:41 +02:00
Derick Rethans
972383fda4 Revert "Partial fixed bug #79649 (Altering disable_functions from module init corrupts memory)"
This reverts commit a297c09da5.
2020-07-09 09:50:25 +01:00
Nikita Popov
77a8a709da Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #79787
2020-07-08 11:22:18 +02:00
XXiang
3d5de7d746 Fix bug #79787
Closes GH-5807.
2020-07-08 11:20:58 +02:00
Nikita Popov
77acc8a069 Fixed bug #79793
Make sure the string key is not released while throwing the
undefined index warning.
2020-07-07 16:29:48 +02:00
Nikita Popov
62bec0e083 Fixed bug #79784
The fix here is essentially the same as for bug #78598, just for
the undefined variable notice, rather than the undefined index one.
2020-07-07 14:22:58 +02:00
Nikita Popov
220880ad2d Fixed bug #78598
When performing an RW modification of an array offset, the undefined
offset warning may call an error handler / OB callback, which may
destroy the array we're supposed to change. Detect this by temporarily
incrementing the reference count. If we find that the array has been
modified/destroyed in the meantime, we do nothing -- the execution
model here would be that the modification has happened on the destroyed
version of the array.
2020-07-07 12:13:58 +02:00
Nikita Popov
48a247178e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79792
2020-07-07 11:59:40 +02:00
Nikita Popov
64931fd3c4 Fixed bug #79792
We need to remove the iterators even if the array is empty (we
will not create one if the first place, but the array may become
empty after the fact).
2020-07-07 11:58:25 +02:00
Nikita Popov
6a9d934b2c Fixed bug #79779
ASSIGN_OBJ_REF was not handling in zend_wrong_string_offset.
2020-07-07 10:27:22 +02:00
Nikita Popov
d9b4974cbc Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79778
2020-07-07 10:20:11 +02:00
Nikita Popov
b765f96f5f Fixed bug #79778
In the interest of avoiding side-effects during dumping, I'm
replacing the value with a <constant ast> string instead of
performing an update constant operation.
2020-07-07 10:19:39 +02:00
Nikita Popov
971e5c5186 Fixed bug #79783
Make sure we don't drop the by-reference check when passing the
result of a VM builtin function.
2020-07-07 09:56:14 +02:00
Christoph M. Becker
993b19ae69 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #70362: Can't copy() large 'data://' with open_basedir
2020-06-30 10:48:07 +02:00
Christoph M. Becker
7f3bc64287 Fix #70362: Can't copy() large 'data://' with open_basedir
open_basedir is only relevant for plain files, so there is no need to
check it for other URL wrappers.
2020-06-30 10:46:53 +02:00
Christoph M. Becker
4af69b8477 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #63208: BSTR to PHP string conversion not binary safe
2020-06-29 19:06:00 +02:00
Christoph M. Becker
a385cfa7ad Fix #63208: BSTR to PHP string conversion not binary safe
A `BSTR` is similar to a `zend_string`; it stores the length of the
string just before the actual string, and thus the string may contain
NUL bytes.  However, `php_com_olestring_to_string()` is supposed to
deal with arbitrary `OLECHAR*`s which may not be `BSTR`s, so we
introduce `php_com_bstr_to_string()` and use it for the only case where
we actually have to deal with `BSTR`s which may contain NUL bytes.

Contrary to `php_com_olestring_to_string()` we return a `zend_string`,
so we can save the re-allocation when converting to a `zval`.

We also cater to `php_com_string_to_olestring()` not being binary safe,
with basically the same fix we did for `php_com_olestring_to_string()`.
2020-06-29 19:05:02 +02:00
Christoph M. Becker
dfac28f8d8 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79756: finfo_file crash (FILEINFO_MIME)
2020-06-29 17:46:46 +02:00
Christoph M. Becker
816b4c1235 Fix #79756: finfo_file crash (FILEINFO_MIME)
If `ctime` or `asctime` return `NULL`, we must not attempt to copy the
buffer, but rather return `NULL` as well.
2020-06-29 17:45:28 +02:00
Nikita Popov
43cd3f6814 Fixed bug #79741 2020-06-26 12:28:39 +02:00
Nikita Popov
c5caa05171 Fixed bug #79740 2020-06-26 10:31:55 +02:00
Nikita Popov
5435a4a9d4 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79030 Use usec from apache request time
2020-06-24 14:43:02 +02:00
Herbert256
4a26628b29 Fixed bug #79030 Use usec from apache request time
Don't unnecessarily truncate to milliseconds.

Closes GH-5760.
2020-06-24 14:41:50 +02:00
Christoph M. Becker
26aefb750a Fix #69804: ::getStaticPropertyValue() throws on protected props
`ReflectionClass` allows reading of the values of private and protected
constants, and also to get private and protected static methods.
Therefore getting the values of private and protected static properties
is also permissible, especially since `::getStaticProperties()` already
allows to do so.

We also allow ::setStaticPropertyValue() to modify private and
protected properties, because otherwise this method is useless, as
modifying public properties can be done directly.
2020-06-24 11:17:36 +02:00
Christoph M. Becker
ef2130db88 Fix #79487: ::getStaticProperties() ignores property modifications
When retrieving the static class properties via reflection, we have to
cater to possible modifications.
2020-06-24 10:05:51 +02:00
Christoph M. Becker
f3cccfde9e Revert "Fix #79487: ::getStaticProperties() ignores property modifications"
This reverts commit a895bb6885.
2020-06-23 19:28:51 +02:00
Christoph M. Becker
a895bb6885 Fix #79487: ::getStaticProperties() ignores property modifications
When retrieving the static class properties via reflection, we have to
cater to possible modifications.
2020-06-23 18:48:54 +02:00
Christoph M. Becker
e7bbac9d11 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #55857: ftp_size on large files
2020-06-23 16:00:11 +02:00
Christoph M. Becker
e94126aac7 Fix #55857: ftp_size on large files
`atol()` returns a `long` which is not the same as `zend_long` on
LLP64; we use `ZEND_ATOL()` instead.

There is no need for a new test case, since filesize_large.phpt already
tests for that behavior; unfortunately, the FTP test suite relies on
`pcntl_fork()` and therefore cannot be run on Windows.
2020-06-23 15:57:24 +02:00
Christoph M. Becker
91982bad63 7.3 is now 7.3.21-dev 2020-06-23 10:29:42 +02:00