1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 22:41:20 +02:00
Commit Graph

61683 Commits

Author SHA1 Message Date
Christoph M. Becker
30b2398860 Merge branch 'PHP-8.1'
* PHP-8.1:
  Preserve file-position when php://temp switches to temporary file
2022-04-11 12:45:48 +02:00
Christoph M. Becker
e3a5e424f6 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Preserve file-position when php://temp switches to temporary file
2022-04-11 12:44:56 +02:00
Bernd Holzmüller
84c18f9f04 Preserve file-position when php://temp switches to temporary file
Closes GH-8333.
2022-04-11 12:31:22 +02:00
Dmitry Stogov
106c908db5 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fix memory lek
2022-04-11 12:21:09 +03:00
Dmitry Stogov
8633893330 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix memory lek
2022-04-11 12:21:02 +03:00
Dmitry Stogov
3aaf2f6f89 JIT: Fix memory lek
Fixes oss-fuzz #46462
2022-04-11 12:17:05 +03:00
Dmitry Stogov
ccef2bc435 Merge branch 'PHP-8.1'
* PHP-8.1:
  Tracing JIT: Fixed incorrect assumption about stack slot type
2022-04-11 11:45:32 +03:00
Dmitry Stogov
69bcd93190 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Tracing JIT: Fixed incorrect assumption about stack slot type
2022-04-11 11:42:56 +03:00
Dmitry Stogov
5b048dd05c Tracing JIT: Fixed incorrect assumption about stack slot type
Fixes oss-fuzz #46404
2022-04-11 11:42:01 +03:00
Nikita Popov
414f7fc2bb Merge branch 'PHP-8.1'
* PHP-8.1:
  Improve type narrowing fix
2022-04-10 11:22:52 +02:00
Nikita Popov
c72e9621ce Improve type narrowing fix
We need to explicitly model the null return type for property
accesses on non-objects.
2022-04-10 11:22:36 +02:00
George Peter Banyard
2ac5948f5c Refactor SplFileObject CSV methods (#8317)
Use early returns, which fixes ValueError order of arguments and flattens the code
2022-04-08 20:16:26 +01:00
George Peter Banyard
3931d726c4 Add missing ZPP checks in SPL Directory (#8325)
Co-authored-by: Máté Kocsis <kocsismate@woohoolabs.com>
2022-04-08 17:58:10 +01:00
George Peter Banyard
6039c07a3a Allow `null and false` as standalone types (#7546)
RFC: https://wiki.php.net/rfc/null-standalone-type

Also a drive-by consistency fix for error messages.
2022-04-08 17:23:52 +01:00
Arnaud Le Blanc
72fb511d0c Stop including php_pcre.h from spl_iterators.h
This fixes GH-7774.

spl_iterators.h was including php_pcre.h so that one object intern struct could
reference a pcre_cache_entry. These object interns should not be public, so they
can be moved out of the header file.

This change moves the object interns ouf of spl_iterators.h so that php_pcre.h
doesn't need to be included from there.
2022-04-08 10:37:12 +02:00
Christoph M. Becker
1a3b85cc64 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8267: MySQLi uses unsupported format specifier on Windows
2022-04-07 17:07:00 +02:00
Christoph M. Becker
22f8886038 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8267: MySQLi uses unsupported format specifier on Windows
2022-04-07 17:06:20 +02:00
Christoph M. Becker
7c702b72f2 Fix GH-8267: MySQLi uses unsupported format specifier on Windows
Instead of using the unsupported `%I64u` and `%I64d` format specifiers
on Windows, we use the portable `PRIu64` and `PRId64` specifiers.

The `L64()` macro and the `my_longlong` typedef should be adapted as
well, as the `i64` literal suffix is still supported by MSVC, but using
`LL` or `ll` is recommended[1], and the standard `int64_t` is available
there anyway.  This is not urgent, though.

[1] <https://docs.microsoft.com/en-us/cpp/cpp/numeric-boolean-and-pointer-literals-cpp?view=msvc-170#integer-literals>

Closes GH-8268.
2022-04-07 17:03:15 +02:00
George Peter Banyard
892270608c Minor refactoring of spl_directory.c
Using more appropriate types
Fix comments
Early returns
2022-04-07 15:12:40 +01:00
Christoph M. Becker
6828f9d1af Fix newly introduced test
We need to tell the test runner that ext/curl is required to run the
test.
2022-04-07 11:59:29 +02:00
Derick Rethans
a4f4b96c91 Updated to version 2022.1 (2022a) 2022-04-07 10:45:21 +01:00
Derick Rethans
7e829d1536 Updated to version 2022.1 (2022a) 2022-04-07 10:45:20 +01:00
Derick Rethans
7aefee1613 Updated to version 2022.1 (2022a) 2022-04-07 10:45:19 +01:00
Derick Rethans
8093ed6168 Implemented FR #51634: Can't post multiple fields with the same name
This PR allows for multiple values with the same field name to be sent to an
HTTP server. This server can't be PHP, because PHP's POST processing does not
allow for two the same field names. But sending multiple fields with the same
name is required for some operations by RFC 7578.

This PR allows you to attach an array of values to a field name, and each of
these will then be sent as its own distinct multipart/form-data field.
2022-04-07 10:01:31 +01:00
Christoph M. Becker
d03a94a0a6 Use proper types in sodium_crypto_stream_xchacha20_xor_ic()
Most importantly, `ic` needs to be of type `zend_long`, not `zend_long*`.

Closes GH-8302.
2022-04-05 16:34:12 +02:00
George Peter Banyard
2fe35cf807 Regenerate optimized func infos
Using the --generate-optimizer-info option for ./build/gen_stubs.php
2022-04-05 13:36:14 +01:00
Christoph M. Becker
012ef7912a Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #81714: segfault when serializing finalized HashContext
2022-04-05 13:36:50 +02:00
Christoph M. Becker
187f5a362d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81714: segfault when serializing finalized HashContext
2022-04-05 13:36:07 +02:00
Christoph M. Becker
c2eafc29f5 Fix #81714: segfault when serializing finalized HashContext
We must not allow to serialize already finalized `HashContext`s, since
the internal context is already freed.  Since there is not much point
in serializing finalized `HashContext`s, we just bail out in that case.

Closes GH-8265.
2022-04-05 13:25:22 +02:00
Máté Kocsis
ee34c298f0 Merge branch 'PHP-8.1'
* PHP-8.1:
  Mark ext/mysqli properties as readonly for documentation purposes
2022-04-05 13:24:51 +02:00
Máté Kocsis
2b4fee03af Mark ext/mysqli properties as readonly for documentation purposes 2022-04-05 13:24:21 +02:00
Dmitry Stogov
df0c8aaee9 JIT: Fix array clobbering by user error handler
Fixes oss-fuzz #46336
2022-04-04 16:47:47 +03:00
Paragon Initiative Enterprises
afd8f84c1a Add sodium_crypto_stream_xchacha20_xor_ic()
There are many use-cases where a PHP user is currently using sodium_compat's implementation of this low-level XChaCha20 API. For example, multi-part message processing (in low-memory settings) for a ciphertext that was encrypted with XChaCha20-Poly1305 (rather than the secretstream API).

Adding this function to ext/sodium offers better performance and lowers users' memory usage with the polyfill, and ensures that users coming from other languages that provide libsodium bindings have a more consistent experience with our bindings. This is a win-win.

This patch follows the libsodium precedent of adding functions instead of optional parameters to existing functions. The parameter order is also consistent with the C API.

https://doc.libsodium.org/advanced/stream_ciphers/xchacha20#usage

Closes GH-8276.
2022-04-04 15:43:42 +02:00
Dmitry Stogov
4f18dbeb97 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fix array clobbering by user error handler
2022-04-04 16:37:17 +03:00
Dmitry Stogov
c489e360a6 JIT: Fix array clobbering by user error handler
Fixes oss-fuzz #46336
2022-04-04 16:36:25 +03:00
Dmitry Stogov
d260e063a8 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed reference counting inference
2022-04-04 15:34:57 +03:00
Dmitry Stogov
e721a42211 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed reference counting inference
2022-04-04 15:34:46 +03:00
Dmitry Stogov
c0bb238483 Fixed reference counting inference
Fixes oss-fuzz #46084
2022-04-04 15:34:02 +03:00
Dmitry Stogov
db34e2a68e Merge branch 'PHP-8.1'
* PHP-8.1:
  Trcing JIT: remove unchecked type guards om ROPE_* instructions
2022-04-04 15:08:01 +03:00
Dmitry Stogov
33704be5f2 Trcing JIT: remove unchecked type guards om ROPE_* instructions
Fixes oss-fuzz #46209
2022-04-04 15:06:35 +03:00
Dmitry Stogov
6156505697 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed incorrect code generation
2022-04-04 14:24:32 +03:00
Dmitry Stogov
24bb178310 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed incorrect code generation
2022-04-04 14:24:10 +03:00
Dmitry Stogov
0d44bbd212 JIT: Fixed incorrect code generation
Fixes oss-fuzz #46328
2022-04-04 14:20:45 +03:00
Christoph M. Becker
53c6619bda Restore memory_reset_peak_usage() declaration
Cf. <https://github.com/php/php-src/pull/8151/files#r819605725>.
2022-04-01 18:13:22 +02:00
George Peter Banyard
083b64efb5 Add missing #endif in stubs
This slipped away during the rebase of 5171cb435a
2022-04-01 16:26:38 +01:00
George Peter Banyard
5171cb435a Fix [-Wundef] warnings in standard extension 2022-04-01 15:48:41 +01:00
George Peter Banyard
62ab9293ae Fix [-Wundef] warnings in SNMP extension 2022-04-01 15:45:44 +01:00
George Peter Banyard
2c2ecba063 Determine value of ZEND_MM_* during config and fix sign conversion (#6981)
Also add a new ZEND_MM_NEED_EIGHT_BYTE_REALIGNMENT definition.

This fixes many [-Wsign-conversion] warnings.

Co-authored-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2022-04-01 15:43:42 +01:00
George Peter Banyard
738adce79f Fix [-Wundef] warnings in DBA extension 2022-04-01 14:38:44 +01:00
Derick Rethans
cd6c338c89 Merge branch 'PHP-8.1' 2022-04-01 13:28:13 +01:00