Commit Graph

136127 Commits

Author SHA1 Message Date
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
Niels Dossche
a356d1c0e9
Update OOM error for DOMImplementation::createDocumentType (#14329)
Most of these kinds of error handling were already changed previously,
but this one was apparently missed.
2024-05-26 17:31:27 +02:00
Niels Dossche
ab80392710
Cleanup DOM exception throwing parameters (#14330) 2024-05-26 14:01:37 +02:00
Peter Kokot
1b78121928
Fix tempnam() path in test when running from out-of-source (#14326)
This fixes test when running the test from unusual paths such as in
out-of-source builds:

```sh
mkdir php-build
cd php-build
../buildconf
../configure
make
./sapi/cli/php ../run-tests.php ../ext/standard/tests/file/002.phpt
```
2024-05-25 23:08:40 +02:00
Jorg Adam Sowa
8a24e31bef
Fixed undefined flags in base64 (#14316) 2024-05-25 14:54:44 +02:00
Peter Kokot
f6b217a2e2
Merge branch 'PHP-8.3'
* PHP-8.3:
  [skip ci] Update NEWS
2024-05-25 14:48:37 +02:00
Peter Kokot
b09922b657
[skip ci] Update NEWS
Adding missed PHP-8.3 entry since these notes must be in all active
branches where the change was done except for the master branch.
2024-05-25 14:47:30 +02:00
haszi
9864d91ea6
Fix typo in LDAP stub (#14313)
Co-authored-by: haszi <haszika80@gmail.com>
2024-05-25 13:31:54 +02:00
David Carlier
e2fe2ee3ab
Merge branch 'PHP-8.3' 2024-05-24 23:35:21 +01:00
David Carlier
72e5ea0f49
Merge branch 'PHP-8.2' into PHP-8.3 2024-05-24 23:35:11 +01:00
David Carlier
19cb9c7b4a
Fix GH-12104 attempt
using stream_select to gives the chance to process the data.

close GH-14311
2024-05-24 23:34:46 +01:00
Niels Dossche
3165456980
Include HRESULT error code if native .NET initialization fails (#14317)
This is a local patch I used to figure out why it didn't work on my
machine. Without the error codes: good luck to figure out what's wrong.
2024-05-25 00:20:07 +02:00
Levi Morrison
c461b60060
refactor: change zend_is_true to return bool (#14301)
Previously this returned `int`. Many functions actually take advantage
of the fact this returns exactly 0 or 1. For instance,
`main/streams/xp_socket.c` does:

    sockopts |= STREAM_SOCKOP_IPV6_V6ONLY_ENABLED * zend_is_true(tmpzval);

And `Zend/zend_compile.c` does:

    child = &ast->child[2 - zend_is_true(zend_ast_get_zval(ast->child[0]))];

I changed a few places trivially from `int` to `bool`, but there are
still many places such as the object handlers which return `int` that
should eventually be `bool`.
2024-05-24 15:16:36 -06:00
Peter Kokot
2ab114ebff
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix incompatible pointer type warnings
2024-05-24 21:01:06 +02:00
Peter Kokot
a893e40139
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix incompatible pointer type warnings
2024-05-24 21:00:54 +02:00
Peter Kokot
9e226b2881
Fix incompatible pointer type warnings
This fixes the incompatible pointer type warnings when checking for
reentrant functions declaractions (-Wincompatible-pointer-types) in
config.log. These were not declared on some obsolete systems if
_REENTRANT was not defined. The check is for now left in the code base
but can be transitioned to newer code without checking for missing
declarations or using these otherwise in the future.

Closes GH-14315.
2024-05-24 20:57:52 +02:00
Ilija Tovilo
547cbf079f
Merge branch 'PHP-8.3'
* PHP-8.3:
  [skip ci] Add missing conflicts for dba test
2024-05-24 14:48:51 +02:00
Ilija Tovilo
dbbf5fff54
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Add missing conflicts for dba test
2024-05-24 14:48:42 +02:00
Ilija Tovilo
184ffe233a
[skip ci] Add missing conflicts for dba test 2024-05-24 14:48:35 +02:00
Niels Dossche
9ad17791c6
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14307: Test curl_basic_024 fails with curl 8.8.0
2024-05-24 14:42:50 +02:00