Commit Graph

120815 Commits

Author SHA1 Message Date
Nikita Popov
d60c43e397 Convert exception instanceof checks to assertions 2020-09-21 17:04:39 +02:00
Nikita Popov
edf22962ef Make constant redeclaration a warning
We missed the change to make this an Error exception in PHP 8,
but at least elevate it to a warning, to avoid a notice -> exception
jump at a later time.
2020-09-21 17:04:39 +02:00
Nikita Popov
54f03d31e0 Promote invalid field to ValueError in pgsql
The same error condition is a ValueError in mysqli, be consistent.

Additionally, do not display the argument name for these errors.
As the signatures are overloaded, the argument name may not match
the meaning at all.
2020-09-21 17:00:23 +02:00
Nikita Popov
68a907569c Remove redundant check
This was already checked directly above.
2020-09-21 17:00:22 +02:00
Christoph M. Becker
3e33e1e86d Check linker compatibility directly from HMODULE
Checking the linker compatibility with extranous `ImageLoad()` calls is
possible, but unnecessary, since the modules are either already loaded
or loaded shortly afterwards, so that we can get the required
information directly from the module handles.  And actually, doing
`ImageLoad()` as well as `LoadLibrary()` leaves a tiny room for a race
condition, because both functions will lookup the module in the search
path, so there is no *guarantee* that both are dealing with the same
module.  Dropping the `ImageLoad()` calls also has the advantage to no
longer face the issue reported in bug #79557.  A very minor additional
advantage is that we no longer have to link against Imagehlp.dll.

Furthermore, there is no need to check for CRT compatibility multiple
times, so we can simplify the signature of `php_win32_crt_compatible`,
and at the same time clean up main.c a bit.

These changes require to change the signature of the exported
`php_win32_image_compatible` and `php_win32_crt_compatible` functions,
which now expect a `HMODULE` and nothing, respectively, instead of the
module name.
2020-09-21 16:25:31 +02:00
Christoph M. Becker
6fa2493789 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix mmap copying
2020-09-21 16:09:17 +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
Máté Kocsis
e95fa3eb0c
Fix a few Iterator signatures
Closes GH-6176
2020-09-21 16:03:09 +02:00
George Peter Banyard
9746490ad4 Drop some connection retries in IMAP test
They are unnecessary and just take time for no good reason
2020-09-21 14:49:53 +01:00
Nikita Popov
d1bbc39e4c pg_unescape_bytea() can only fail on OOM
The implementation did not check for PQunescapeBytea failure
correctly, because it checked for a null pointer after estrndup,
which certainly cannot happen. Inspection of the PGunescapeBytea
implementation has shown that this function can only fail on OOM,
so let's check for that explicitly and remove false as a possible
return type.

While we're here, avoid an unnecessary copy of the result.
2020-09-21 15:46:55 +02:00
Nikita Popov
5bb41fa63c Promote PDORow property write to Error 2020-09-21 15:33:39 +02:00
Nikita Popov
6f76817f02 Remove dead code
The "if ever" here is the relevant bit...
2020-09-21 15:33:39 +02:00
George Peter Banyard
e55f0c796c Promote warnings to Error in COM extension
Closes GH-6141
2020-09-21 14:32:00 +01:00
Nikita Popov
213b666781 Synchronize GET_CLASS/GET_CALLED_CLASS opcodes with functions
These error conditions throw in the function implementations,
make the opcodes match.
2020-09-21 15:06:04 +02:00
Nikita Popov
d085a7439f Assert on unknown list entry type 2020-09-21 14:58:23 +02:00
Nikita Popov
3642592a12 Remove unnecessary check
We should only produce IS_UNDEF if an exception is thrown, this
check is not needed.
2020-09-21 14:56:14 +02:00
Nikita Popov
8e0789a21c Use proper parameter type in Closure::bindTo() signature 2020-09-21 14:46:10 +02:00
Máté Kocsis
4c821cf206
Improve default value handling of Exception constructors
Closes GH-6166
2020-09-21 12:46:50 +02:00
Nikita Popov
9f074a5c31 Move arm64 job to cron
As we're branching soon, reduce the number of jobs we run on each
commit, so that Travis can keep up with its role as the fast
feedback build.
2020-09-21 12:42:48 +02:00
Nikita Popov
c5f93d191e Fix detection of code outside namespace
Due to improvements to early binding, the opcode based check is
no longer accurate. Reuse the syntactic check we're already using
for declares instead.
2020-09-21 12:37:44 +02:00
Nikita Popov
ef9ab9159b Use assertion for null-termination string
Indicates an implementation bug, make sure we can automatically
detect it.
2020-09-21 12:12:51 +02:00
Larry Garfield
94854e0dff Standardize mbstring and string on using 'string' as a parameter name.
Closes GH-6171.
2020-09-21 12:06:50 +02:00
Nikita Popov
7300f6fc17 Deprecate pgsql function aliases
These have been documentation-deprecated for a very long time,
make it official.
2020-09-21 11:33:05 +02:00
Christoph M. Becker
4591cb8a07 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix memory leak in php_imap_mutf7()
2020-09-21 11:27:51 +02:00
Christoph M. Becker
d1feeed7f3 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix memory leak in php_imap_mutf7()
2020-09-21 11:26:41 +02:00
Christoph M. Becker
730fdc77a7 Fix memory leak in php_imap_mutf7()
We have to free the string which has been allocated by libc-client.
2020-09-21 11:25:46 +02:00
Nikita Popov
2bf2cede89 Initialize attributes for internal functions
Fixes a crash in Symfony SecurityBundle tests.
2020-09-21 10:50:29 +02:00
Christoph M. Becker
48e9181519 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80118: Erroneous whitespace match with JIT only
2020-09-21 10:29:36 +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
Máté Kocsis
64af12d13b
Add support for @implementation-alias in stubs
Closes GH-6170
2020-09-21 10:08:45 +02:00
George Peter Banyard
3b67f183b1 Update README for how to setup IMAP tests
This details which packages needs to be installed on Ubuntun 18.04,
which configure flags are necessary and what the setup.sh shell script does.
2020-09-20 22:20:34 +01:00
Máté Kocsis
e950ca13ea
Consolidate the usage of "either" and "one of" in error messages
Closes GH-6173
2020-09-20 19:41:47 +02:00
Christoph M. Becker
c0f8cc1904 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80114: parse_url does not accept URLs with port 0
2020-09-20 15:38:18 +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
93745a242f Only check linking in PHP_TEST_BUILD
Given that this executes a random function with zero parameters,
actually executing the code doesn't make sense.

This should fix the imap + asan build.
2020-09-20 10:24:54 +02:00
Nikita Popov
e5082af69f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix mysqli build with mysqlnd and without PDO
2020-09-20 10:03:10 +02:00
Nikita Popov
9d1c7f8b13 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix mysqli build with mysqlnd and without PDO
2020-09-20 10:02:32 +02:00
Bob Weinand
a7544411df Fix mysqli build with mysqlnd and without PDO 2020-09-20 10:02:09 +02:00
Bob Weinand
0741858ca7 Fix mysqli build with mysqlnd and without PDO 2020-09-20 02:57:39 +02:00
Máté Kocsis
b15885b522
Separate Closure::bind() implementations
Closure::bind() and Closure::bindTo() are currently reported as aliases in stubs because they have a single implementation. They are not aliases in fact though, they just use zend_parse_method_parameters() cleverly.

Thus, let's separate their implementation so that we don't have to alias Closure::bindTo() anymore. This will also have the advantage that the two ZPP implementations become more clear.

Closes GH-6169
2020-09-19 20:14:22 +02:00
Máté Kocsis
f088aec6cb
Fix UNKNOWN default value of apache_note()
Closes GH-6167
2020-09-19 16:22:18 +02:00
Máté Kocsis
40e8c7c90b
Adjust the order of method modifiers in stub
All the other method modifiers in stubs follow the guidelines of PSR-12, so let's use it in case of PhpToken::__construct() as well.
2020-09-19 12:32:02 +02:00
Sammy Kaye Powers
12306728c5
Add system ID entropy API
The `zend_system_id` is a (true global) system ID that fingerprints a process state. When extensions add engine hooks during MINIT/startup, entropy is added the system ID for each hook. This allows extensions to identify that changes have been made to the engine since the last PHP process restart.

Closes GH-5871
2020-09-18 14:26:44 -07:00
George Peter Banyard
30bb15b24a Fix IMAP tests
Drop various ZPP checks and make them PASS
Add CONFLICT file as the tests all hit the same mailbox
2020-09-18 23:02:01 +02:00
George Peter Banyard
ef9359d30f Set-up IMAP in Azure
Closes GH-6162
2020-09-18 23:02:01 +02:00
Nikita Popov
19314ff887 Fix some tests for libmysql 2020-09-18 18:01:04 +02:00
Nikita Popov
2d002258b8 Drop skipifemb.inc
And drop the last remaining uses of it.
2020-09-18 15:49:35 +02:00
Nikita Popov
b40ffa9bfd Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78179: mysqli/mysqlnd transaction extensions
2020-09-18 15:30:13 +02:00
Nikita Popov
f23164584e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78179: mysqli/mysqlnd transaction extensions
2020-09-18 15:30:06 +02:00