Commit Graph

134329 Commits

Author SHA1 Message Date
Niels Dossche
bfb678a266 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-12854: 8.3 - as final trait-used method does not correctly report visibility in Reflection
2023-12-05 21:49:42 +01:00
Niels Dossche
e679ab36b3 Fix GH-12854: 8.3 - as final trait-used method does not correctly report visibility in Reflection
Closes GH-12857.
2023-12-05 21:49:29 +01:00
Pierrick Charron
94c37b6ef3
Merge branch 'PHP-8.3'
* PHP-8.3:
  PHP-8.2 is now for PHP 8.2.15-dev
  PHP-8.3 is now for PHP 8.3.2-dev
2023-12-05 15:02:35 -05:00
Pierrick Charron
8c5f6257da
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  PHP-8.2 is now for PHP 8.2.15-dev
2023-12-05 15:02:07 -05:00
Pierrick Charron
dc3641ea0f
PHP-8.2 is now for PHP 8.2.15-dev 2023-12-05 15:01:08 -05:00
Eric Mann
1fdf21fe84
PHP-8.3 is now for PHP 8.3.2-dev 2023-12-05 07:56:55 -08:00
Patrick Allaert
44df59dc94
Merge branch 'PHP-8.3' 2023-12-05 15:06:22 +01:00
Patrick Allaert
e8bf2c548e
Merge branch 'PHP-8.2' into PHP-8.3 2023-12-05 15:05:56 +01:00
Patrick Allaert
e8aa51460d
Merge branch 'PHP-8.1' into PHP-8.2 2023-12-05 15:05:40 +01:00
Patrick Allaert
8f6610ce88
PHP-8.1 is now for PHP 8.1.28-dev
(If released one day!)
2023-12-05 15:05:00 +01:00
Ilija Tovilo
016c3861d7
Fix asan false positive for mmap
For some reason, mmap regions which are repeatedly munmapped are not correctly
unpoisoned. See https://github.com/google/sanitizers/issues/1705.

Fixes GH-12756
Closes GH-12848
2023-12-05 12:18:09 +01:00
Ilija Tovilo
289073b452
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix compilation of ftp without openssl
2023-12-05 11:59:04 +01:00
Ilija Tovilo
b4b157edab
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix compilation of ftp without openssl
2023-12-05 11:56:15 +01:00
Ilija Tovilo
4f934cb7f7
Fix compilation of ftp without openssl
Closes GH-12866
2023-12-05 11:55:44 +01:00
Dmitry Stogov
8cc6b3576e
Fixed GH-12596: Segmentation fault on AArch64 release build with opcache.jit=1112 (#12813) 2023-12-05 12:04:00 +03:00
Michael Voříšek
8d98f7202a
Use ZSTR_IS_VALID_UTF8 macro where possible (#12869) 2023-12-05 05:24:11 +00:00
Gina Peter Banyard
b532b9a294
ext/mbstring: use unsigned char for variable with max value of 255 2023-12-05 05:15:53 +00:00
Gina Peter Banyard
840d800d15
ext/mbstring: Move variable declaration to inner scope 2023-12-05 05:15:41 +00:00
Gina Peter Banyard
ce82c48c08
ext/mbstring: Use bool where more appropriate instead of int 2023-12-05 05:15:32 +00:00
Gina Peter Banyard
3f64a7c008
ext/mbstring: Use unsigned int where more appropriate instead of int 2023-12-05 05:15:22 +00:00
Gina Peter Banyard
7c1ec84ead
ext/mbstring: Use size_t where more appropriate instead of int 2023-12-05 05:15:14 +00:00
Gina Peter Banyard
298f848513
ext/mbstring: use zend_result return type where appropriate 2023-12-05 05:15:06 +00:00
Niels Dossche
9c306470fb
Handle libxml2 OOM more consistently (#11927)
This is a continuation of commit c2a58ab07d, in which several OOM error
handling was converted to throwing an INVALID_STATE_ERR DOMException.
Some places were missed and they still returned false without an
exception, or threw a PHP_ERR DOMException.
Convert all of these to INVALID_STATE_ERR DOMExceptions. This also
reduces confusion of users going through documentation [1].

Unfortunately, not all node creations are checked for a NULL pointer.
Some places therefore will not do anything if an OOM occurs (well,
except crash).
On the one hand it's nice to handle these OOM cases.
On the other hand, this adds some complexity and it's very unlikely to
happen in the real world. But then again, "unlikely" situations have
caused trouble before. Ideally all cases should be checked.

[1] https://github.com/php/doc-en/issues/1741
2023-12-04 23:49:25 +01:00
Máté Kocsis
2cd8f3e625
Retain a RETURN_THROWS() in ext/sqlite3 2023-12-04 22:52:20 +01:00
Máté Kocsis
2d057757c4 Deprecate calling stream_context_set_option() with 2 arguments 2023-12-04 22:35:30 +01:00
Máté Kocsis
b36eac94d2 Deprecate calling session_set_save_handler() with more than 2 arguments 2023-12-04 22:35:30 +01:00
Máté Kocsis
688c6f373c Deprecate calling ReflectionMethod::__construct() with 1 argument 2023-12-04 22:27:59 +01:00
Máté Kocsis
beaf1e814a Deprecate calling pg_fetch_result(), pg_field_prtlen(), and pg_field_is_null() with 2 arguments 2023-12-04 22:27:59 +01:00
Máté Kocsis
682c2366be Deprecate calling ldap_exop() with more than 4 arguments 2023-12-04 22:27:59 +01:00
Máté Kocsis
1d41eb3014 Deprecate calling ldap_connect() with more than 2 arguments 2023-12-04 22:27:59 +01:00
Máté Kocsis
811245d2e0 Calling IntlGregorianCalendar::__construct() with more than 2 arguments and intlgregcal_create_instance() 2023-12-04 22:27:59 +01:00
Máté Kocsis
f4df37af3d Deprecate calling IntlCalendar::set() with more than 2 arguments and intlcal_set() 2023-12-04 22:27:59 +01:00
Máté Kocsis
adc26424aa Deprecate calling DatePeriod::__construct() with less than 3 arguments 2023-12-04 22:27:59 +01:00
Saki Takamachi
866aa12bcd
ext/pdo: Fixed PDO::setAttribute() and PDO::getAttribute() (#12793) 2023-12-04 16:05:30 +00:00
Dmitry Stogov
e502aaf0c5 Prevent starting JIT on x86_64 with buffuer size above 2G 2023-12-04 13:29:47 +03:00
Alex Dowad
c1a37c4ad4 Optimize mb_strcut for text encodings with mblen_table
For legacy text encodings where mb_strcut is implemented using an
mblen_table (such as the various SJIS variants), mb_strcut is now
~30% faster on small strings (about 10 bytes). This is because we
are now avoiding an extra, unnecessary copy operation on the
output string.

When used on large strings, the difference in performance is
negligible, as almost the entire runtime is spent stepping through
the string to find the starting and ending cut points.
2023-12-04 07:48:02 +02:00
Niels Dossche
775fb31d01 [ci skip] Add missing patch files 2023-12-03 22:48:03 +01:00
Máté Kocsis
7d5b754fd3
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix the default value of fetchMode in PDO::pgsqlGetNotify()
2023-12-03 09:17:22 +01:00
Máté Kocsis
b500ddd7a9
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix the default value of $fetchMode in PDO::pgsqlGetNotify()
2023-12-03 09:11:43 +01:00
Máté Kocsis
8387f2dfd4
Fix the default value of $fetchMode in PDO::pgsqlGetNotify() 2023-12-03 09:01:06 +01:00
Niels Dossche
f3cddbb831 Remove redundant assignments to ftp->data
ftp_getdata() already does this.

Closes GH-12849.
2023-12-03 00:59:17 +01:00
Niels Dossche
35cf7abec7 Cleanup internal data_close API
This always returns NULL. Also passing in data is not necessary as it is
always equal to ftp->data.
2023-12-03 00:58:50 +01:00
Niels Dossche
f601963d4f Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-9348: FTP & SSL session reuse
2023-12-03 00:52:15 +01:00
Niels Dossche
addb6e463a Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-9348: FTP & SSL session reuse
2023-12-03 00:52:08 +01:00
Niels Dossche
ac8a58fab1 Fix GH-9348: FTP & SSL session reuse
The issue referenced here doesn't contain a reproducer, but I recently
received an email of a user with the exact same problem. I was able to
recreate the scenario locally using vsftpd and setting
`require_ssl_reuse=YES` in the vsftpd configuration.

It turns out that our session resumption code is broken. It only works a
single time: the first time a data connection opens. Subsequent data
connections fail to reuse the session. This is because on every data
connection a new session is negotiated, but the current code always
tries to reuse the (stale) session of the control connection.

To fix this, we use SSL_CTX_sess_set_new_cb() to setup a callback that
gets called every time a new session is negotiated. We take a strong
reference using SSL_get1_session() and store it in the ftpbuf_t struct.
Every time we open a data connection we'll take that session.
This works because every control connection has at most a single
associated data connection.

Also disable internal session caching storage to not fill the cache up
with useless sessions.

There is no phpt for this because PHP does not support enforcing SSL
session reuse.
It is however testable manually by setting up vsftpd and setting the
`require_ssl_reuse=YES` function from before.

Closes GH-12851.
2023-12-03 00:47:33 +01:00
Alex Dowad
5f1477d144 Optimize mb_strcut for fixed-byte-length text encodings
On microbenchmarks run on my dev machine, mb_strcut is now ~50% faster
for fixed-byte-length text encodings like ASCII. (This is because the
previous code did an extra, unnecessary copy operation on the
resulting output string.)
2023-12-02 14:10:54 +02:00
Niels Dossche
58fc521713 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix libxml2 2.12 build due to API breaks
2023-12-01 18:07:58 +01:00
Niels Dossche
f61f8d439c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix libxml2 2.12 build due to API breaks
2023-12-01 18:07:13 +01:00
Niels Dossche
0a39890c96 Fix libxml2 2.12 build due to API breaks
See https://github.com/php/php-src/actions/runs/7062192818/job/19225478601
2023-12-01 18:03:37 +01:00
Niels Dossche
6edbbc1c3e Implement GH-12385: flush headers without body when calling flush()
Closes GH-12785.
2023-12-01 17:15:57 +01:00