Commit Graph

136146 Commits

Author SHA1 Message Date
Tim Düsterhus
8a87206211
reflection: Add ReflectionGenerator::isClosed() (#14358)
* reflection: Add `ReflectionGenerator::isClosed()`

see https://github.com/php/php-src/pull/14167#issuecomment-2133641998

* Fix test expectation

* Drop `{{{` / `}}}` comments around `ReflectionGenerator::isClosed()`
2024-05-29 19:07:09 +02:00
Niels Dossche
f90a32c9bf
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix build
2024-05-29 18:50:13 +02:00
Niels Dossche
edc130910f
Fix build 2024-05-29 18:50:07 +02:00
Niels Dossche
acfa564e72
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix bug #47925 again (#14348)
  Fix GH-14343: Memory leak in xml and dom (#14347)
2024-05-29 17:52:00 +02:00
Niels Dossche
fe0214bb55
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug #47925 again (#14348)
  Fix GH-14343: Memory leak in xml and dom (#14347)
2024-05-29 17:51:47 +02:00
Niels Dossche
ce7ed6e040
Fix bug #47925 again (#14348)
The naming of the userland functions is terrible and confused me.
gzdecode() is actually the function to decompress a gzip stream, and
gzuncompress() is the one to decompress a deflate stream...
See zlib.c to see the internal function -> type mapping.
2024-05-29 17:50:20 +02:00
Niels Dossche
88ff32a25b
Fix GH-14343: Memory leak in xml and dom (#14347)
If there is no root, the namespace cannot be attached to it,
so we have to attach it to the old list.

This isn't a problem in "new DOM" because namespaces are managed in a
separate structure there.
2024-05-29 17:49:07 +02:00
Niels Dossche
e6abca4d24
Use helper macro in ext/exif (#14352) 2024-05-29 17:48:43 +02:00
Máté Kocsis
0f64901316
Document stubs (#13677)
Co-authored-by: Derick Rethans <github@derickrethans.nl>
2024-05-29 14:18:22 +02:00
Ilija Tovilo
9771302e29
Merge branch 'PHP-8.3'
* PHP-8.3:
  Attempt to fix mysql_native_password error for 32-bit build
2024-05-29 12:49:51 +02:00
Ilija Tovilo
3250457242
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Attempt to fix mysql_native_password error for 32-bit build
2024-05-29 12:49:43 +02:00
Ilija Tovilo
a05301e783
Attempt to fix mysql_native_password error for 32-bit build
Closes GH-14356
2024-05-29 12:48:47 +02:00
Gina Peter Banyard
48d5ae98e7
ext/standard: Refactor exec.c public APIs to use zend_string pointers (#14353)
* Pull zend_string* from INI directive

* Ensure that mail.force_extra_parameters INI directive does not have any nul bytes

* ext/standard: Make php_escape_shell_cmd() take a zend_string* instead of char*

This saves on an expensive strlen() computation

* Convert E_ERROR to ValueError in php_escape_shell_cmd()

* ext/standard: Make php_escape_shell_arg() take a zend_string* instead of char*

This saves on an expensive strlen() computation

* Convert E_ERROR to ValueError in php_escape_shell_arg()
2024-05-29 10:59:17 +01:00
Ilija Tovilo
06fcf3c029
Merge branch 'PHP-8.3'
* PHP-8.3:
  Re-add 32-bit push build
2024-05-29 11:50:45 +02:00
Ilija Tovilo
9f77c1f995
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Re-add 32-bit push build
2024-05-29 11:49:49 +02:00
Ilija Tovilo
69dbfadd1e
Re-add 32-bit push build
32-bit fails more commonly that I had assumed.

Closes GH-14300
2024-05-29 11:47:24 +02:00
Peter Kokot
e45d2d6046
Sync HAVE_BUNDLED_PCRE #if/ifdef/defined (#14354)
Follow up of GH-5526 (-Wundef)
2024-05-29 07:53:36 +02:00
Peter Kokot
cb2c5de3db
Add PHP_SBINDIR (#13363)
The PHP_SBINDIR symbol was defined on *nix systems but never used. This
adds the constant similar to PHP_BINDIR also to PHP. On Windows it is
the value of prefix configuration when PHP was built (same value as
PHP_BINDIR).
2024-05-29 07:04:05 +02:00
Niels Dossche
7278364f9c
Remove useless RETURN_NULLs() (#14350)
These functions are void, their use of RETURN_NULL() was mildly
confusing.
2024-05-28 22:59:37 +02:00
Peter Kokot
1d0cdd1b41
Remove unused ext/fileinfo/libmagic/elfclass.h file (#14344)
Usage was removed via 919abf0cb1 due to
redundand code in php-src. This also updates the appended libmagic patch
file.
2024-05-28 21:43:38 +02:00
Máté Kocsis
cf004ed47e
Fix implicitly nullable type detection in stubs 2024-05-28 21:06:00 +02:00
Máté Kocsis
661c5ee546
Fix implicitly nullable parameter type for pg_put_copy_end() 2024-05-28 20:11:01 +02:00
David Carlier
162a311cc8
ext/pgsql: adding pg_put_copy_data/pg_put_copy_end.
pg_put_copy_data allows to send COPY commands to the server.
pg_put_copy_end signals the end of the n commands.

Both return 3 states ; 1, 0 and -1 when 1 is success, 0 the buffer queue
is full then -1 for errors.

Close GH-14325
2024-05-28 18:35:40 +01:00
Arnaud Le Blanc
cc6d9523d9
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix TLS access in JIT on FreeBSD/amd64
2024-05-28 15:45:45 +02:00
Arnaud Le Blanc
5e895dda15
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix TLS access in JIT on FreeBSD/amd64
2024-05-28 15:43:59 +02:00
Arnaud Le Blanc
79862f24da
Fix TLS access in JIT on FreeBSD/amd64
DTV elements are 8 bytes in size a per ABI [1], and the index is offset by 1
on FreeBSD [2]

[1] http://people.redhat.com/drepper/tls.pdf
[2] bf56e8b9c8/libexec/rtld-elf/rtld.c (L5260)

Closes GH-13928
2024-05-28 15:42:57 +02:00
Arnaud Le Blanc
7c5d6557e1
Merge branch 'PHP-8.3'
* PHP-8.3:
  Use ITIMER_REAL for timeout handling on MacOS / Apple Silicon system
2024-05-28 15:27:32 +02:00
Arnaud Le Blanc
3b2764bc76
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Use ITIMER_REAL for timeout handling on MacOS / Apple Silicon system
2024-05-28 15:26:53 +02:00
Manuel Kress
272da51bfd
Use ITIMER_REAL for timeout handling on MacOS / Apple Silicon system
setitimer(ITIMER_PROF) fires too early on MacOS 14 when running on Apple
Silicon. See https://openradar.appspot.com/radar?id=5583058442911744.

Fixes GH-12814
Closes GH-13567
2024-05-28 15:25:46 +02:00
Peter Kokot
2d66562e4b
Sync HAVE_IPV6 and HAVE_GETADDRINFO in #if/ifdef/defined (#14341)
Follow up of GH-5526 (-Wundef)
2024-05-28 11:52:25 +02:00
Dmitry Stogov
5109cf1010
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix incorrect conditions
2024-05-28 08:38:00 +03:00
Dmitry Stogov
034bd85ad1
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix incorrect conditions
2024-05-28 08:37:48 +03:00
Dmitry Stogov
48ae025c33
Fix incorrect conditions 2024-05-28 08:37:20 +03:00
Valentin Udaltsov
b6b16a1758
[RFC] Implement dereferencable for new exprs with constructor args
https://wiki.php.net/rfc/new_without_parentheses

Closes GH-13029
2024-05-28 00:23:12 +02:00
Máté Kocsis
cc477ff3bb
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix gen_stub.php errors (#14335)
2024-05-27 22:49:59 +02:00
Máté Kocsis
9ac59d08e4
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix gen_stub.php errors (#14335)
2024-05-27 22:47:24 +02:00
Valentin Udaltsov
583ac15cd6
Fix gen_stub.php errors (#14335) 2024-05-27 22:46:50 +02:00
Valentin Udaltsov
be19e7954d
Fix gen_stub.php errors (#14335) 2024-05-27 22:11:23 +02:00
Peter Kokot
329f015c91
Sync HAVE_ENCHANT_BROKER_SET_PARAM definitions (#14340)
This defines the HAVE_ENCHANT_BROKER_SET_PARAM to 1 or doesn't define it
so it can be used in a similar way between platforms. It is only defined
for Enchant versions 1.5.0 to 2.x. Previously on Windows it was defined
to 0 if not found.
2024-05-27 21:59:44 +02:00
Niels Dossche
8896bd3200
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix bug #47925: PHPClient can't decompress response (transposed uncompress methods?)
2024-05-27 19:24:18 +02:00
Niels Dossche
deeeacf42a
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix bug #47925: PHPClient can't decompress response (transposed uncompress methods?)
2024-05-27 19:24:10 +02:00
Niels Dossche
35e62e9b59
Fix bug #47925: PHPClient can't decompress response (transposed uncompress methods?)
The incorrect functions are being called to deal with incoming
compressed data.
gzip/x-gzip corresponds to gzuncompress(), while deflate corresponds to
gzinflate().

The existing code for gzip compression also plays with removing the
first 10 bytes (i.e. the gzip header) to pass it to the inflate
implementation but that doesn't always work properly due to trailer
data. Get rid of that entirely by using the correct functions.

Closes GH-14321.
2024-05-27 19:23:40 +02:00
Niels Dossche
a70fd5386b
Move regression tests of SOAP to bugs directory (#14322)
There's a bugs directory but it wasn't always used, move the regression
tests to this directory.
2024-05-27 19:21:35 +02:00
Peter Kokot
4f311f86cc
Remove redundant ext/spl/spl_exceptions.h include (#14337) 2024-05-27 15:40:07 +02:00
Manuel Mausz
5f2a0c8383
Add support for Curve25519 + Curve448 based keys
For openssl_pkey_get_details we export the priv+pub parameters.

ED25519/ED448 do not support streaming, so we need to use
EVP_Digest{Sign,Verify} instead. In general the older EVP_{Sign,Verify}
interface should be avoided as the key is passed very late.
See BUGS section in OpenSSL manpages of EVP_{Sign,Verify}Final

Additionally per requirement we need to allow sign/verify without
digest. So we need to allow passing 0 as digest. In OpenSSL 3.0+ this also
corresponds to the default digest (see EVP_PKEY_get_default_digest_name).

For CSR creation we need to allow "null" as digest_alg option.

Closes GH-14052
2024-05-27 12:52:57 +01:00
Peter Kokot
6e1d20c86f
Wrap sched_getcpu AC_RUN_IFELSE check in AC_CACHE_CHECK (#14336)
For cross-compiling configuration, this wraps the check with the
php_cv_func_sched_getcpu variable.
2024-05-27 13:40:18 +02:00
Tim Düsterhus
8cf8751533
random: Remove internal aliases for the global Mt19937 functionality (#14314)
* random: Remove `php_rand()`

This effectively is just a slim wrapper around `(zend_long)php_mt_rand()`. It
is not compatible between 32-bit and 64-bit builds of PHP, due to the use of
`zend_long`, which may result in negative integersbeing returned on 32-bit
platforms, whereas 64-bit platforms will be compatible with `php_mt_rand()`. An
example would be the `0` seed, which emits 2357136044 on 64-bit platforms and
-1937831252 on 32-bit platforms.

Users of `php_rand()` should ideally migrate to one of the more modern engines,
with extension-specific state. If drop-in compatibility is desired, they can
just cast the result of `php_mt_rand()`. But providing it out of the box does
not provide a value-add and is potentially dangerous.

* random: Remove `php_srand()`

With `php_rand()` gone, preserving its companion `php_srand()` is just
confusing. The same recommendations apply: Migrate to a modern engine if
possible and just call `php_mt_srand()` with an appropriately casted input.

* random: Remove `PHP_RAND_MAX` and `RAND_MAX`

These are the companions to `php_rand()`, which was removed in a previous
commit.

Generally speaking the maximum returnable value is not particularly useful
anyways. Attempting it to create a random float by dividing the returned
integer by the maximum value would result in a bias if the maximum value would
be larger than 2**53 and even for that case, the various `range()` helpers
allow to easily retrieve a uniformly distributed integer from a suitable range.

* UPGRADING.INTERNALS
2024-05-27 08:12:13 +02:00
Peter Kokot
d4839b96c2
Remove outdated comment
Comment referred to the headers installation step when the
PHP_INSTALL_HEADERS wasn't yet available:
9e9f413aeb
2024-05-27 06:52:00 +02:00
Peter Kokot
8be3426a7f
Add missing ext/libxml dependency to ext/xmlwriter (#14327)
This adds the libxml extension to required dependencies for xmlwriter
during the configuration phase (PHP_ADD_EXTENSION_DEP) and the runtime
(ZEND_MOD_REQUIRED).

The libxml is technically not a required extension in this case but
it necessary to make it work properly (i.e. have proper error
reporting, etc.). Added due to prior libxml requirement in
documentation and build system.
2024-05-26 19:27:55 +02:00
Niels Dossche
36a58b35f2
Use a ROL for mangling the pointer key in namespace_compat.c (#14331)
This might be a safer than throwing the lower bits away.
2024-05-26 17:31:40 +02:00