1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

6496 Commits

Author SHA1 Message Date
Alexandre Daubois
a8543dfdd2 Convert remaining zend_parse_parameters_none() to ZPP (#21343) 2026-03-16 09:28:08 +01:00
Ilija Tovilo
0039af028c Propagate bind error for stream_socket_server()
When stream_socket_server() fails during bind(), we're currently only showing
"Unknown error" in the error message. Properly propagate this error for better
diagnostics.

Closes GH-21328
2026-03-16 08:53:38 +01:00
Ilija Tovilo
92ba1e4ea0 Prevent closing of innerstream of php://temp stream
Fixes GH-21221
Closes GH-21222
2026-03-13 20:34:04 +01:00
ndossche
bfd66bbdf0 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix compile warnings under GCC 15.2.1 (#21320)
  Updated to version 2026.1 (2026a)
2026-03-02 23:13:40 +01:00
ndossche
210704258a Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix compile warnings under GCC 15.2.1 (#21320)
2026-03-02 23:12:48 +01:00
Nora Dossche
583be5a8ca Fix compile warnings under GCC 15.2.1 (#21320)
The compiler now infers constness through string functions.
Adhere to that.
It also now warns about using multiplications in conditions.
2026-03-02 23:12:06 +01:00
Daniel Scherzer
90cb181844 php_version.h: remove trailing whitespace
Causes the verification of generated files to fail
2026-02-24 18:45:08 -05:00
Calvin Buckley
9942f063db PHP-8.4 is now for PHP 8.4.20-dev 2026-02-24 17:50:02 -05:00
Daniel Scherzer
022793ee5a Fix missed php_version changes 2026-02-24 11:54:25 -05:00
Daniel Scherzer
ee1e5f295d PHP-8.5 is now for PHP 8.5.5-dev 2026-02-24 11:10:09 -05:00
Arnaud Le Blanc
bc5f8782a0 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix build with -std=
2026-02-16 14:53:53 +01:00
Arnaud Le Blanc
6f32a4a7df Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix build with -std=
2026-02-16 14:52:27 +01:00
Arnaud Le Blanc
ede7c67389 Fix build with -std=
When building in strict mode (e.g. -std=c11), compilation of
main/debug_gdb_scripts.c fails because asm() is not a standard top level
statement. __asm__() however can be reserved by the compiler even in strict
mode.

Partially fixes GH-21215. IR needs a similar fix (dstogov/ir#128).
Closes GH-21226.
2026-02-16 14:48:48 +01:00
Peter Kokot
8032d6fa16 Autotools: Check struct stat.st_blocks with AC_CHECK_MEMBERS (#13562)
The AC_STRUCT_ST_BLOCKS expects fileblocks object to be compiled with
AC_LIBOBJ if stat.st_blocks is missing on the system. This can be
simplified with the usual AC_CHECK_MEMBERS since PHP is using the
stat.st_blocks (and stat.st_blksize) conditionally.

These members are mostly present on all POSIX-based systems except on
Windows these days.

This also removes the obsolete HAVE_ST_BLOCKS symbol:
https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/types.m4?h=v2.72#n1055

Additionally, the st_blksize and st_blocks members are checked
conditionally with HAVE_ preprocessor macros. Instead of filtering
Windows specifically here, the preprocessor macros
HAVE_STRUCT_STAT_ST_BLKSIZE and HAVE_STRUCT_STAT_ST_BLOCKS can be used.
2026-02-10 19:59:10 +01:00
Tim Düsterhus
a15ba7672c zend_ini: Make ZEND_INI_GET_ADDR() return a void* pointer (#21119)
* zend_ini: Make `ZEND_INI_GET_ADDR()` return a `void*` pointer

Since the actual type of the storage location is not known, a `void*` is more
appropriate and avoids explicit casts that are no more safe than the implicit
cast from `void*`.

* tree-wide: Remove explicit casts of `ZEND_INI_GET_ADDR()`

* UPGRADING.INTERNALS
2026-02-04 11:11:11 +01:00
Khaled Alam
32bd33983d Remove unreachable code after zend_error_noreturn calls (GH-20983) 2026-02-02 14:14:15 +01:00
Khaled Alam
d03d69a88a Remove duplicate #include statements (#21085)
* Remove duplicate #include statements across the codebase.

* feat: Restore conditional/unconditional include pairs in lscriu.c
2026-01-30 16:37:13 +01:00
Calvin Buckley
4d5b651e90 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix regression with header removal removing whole prefixes (#21020)
2026-01-28 16:50:26 -04:00
Calvin Buckley
cd32c597a7 Fix regression with header removal removing whole prefixes (#21020)
* Fix regression with header removing removing whole prefixes

The header removal code looked for the colon for key-value at the wrong
place, so it would overzealously remove headers. Tweak that condition,
and make the alternative condition only active if it's set (with the
remove prefix op case).

Fixes GH-21018.

* avoid reading past the actual length

* Rename variable to be more clear
2026-01-28 16:50:06 -04:00
Gina Peter Banyard
668606816f Zend: move class autoloading from SPL to Zend (#21001)
The primary motivation for this change is that this sort of functionality should reside in core and not in an extension.
The reason being is that this causes issues in regard to extension dependencies and resolution,
something that prevents GH-14544.
2026-01-28 01:57:30 +00:00
Volker Dusch
b5d3d8647f PHP-8.5 is now for PHP 8.5.4-dev 2026-01-27 17:37:51 +01:00
Saki Takamachi
e6beffb6ed PHP-8.4 is now for PHP 8.4.19-dev 2026-01-27 22:21:42 +09:00
Arnaud Le Blanc
65b4073922 Include the actual stub name in generated arginfo headers (#20993) 2026-01-21 20:57:00 +01:00
Jordi Kroon
a7abaa012b always add PHP_MANDIR if exists (#20825) 2026-01-14 15:54:53 +01:00
Tim Düsterhus
265c0c632b Merge branch 'PHP-8.5'
* PHP-8.5:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:37 +01:00
Tim Düsterhus
1f3390283d Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  output: Fail starting to output buffer when the output layer is deactivated (#20846)
2026-01-10 14:38:27 +01:00
Tim Düsterhus
b5d6377ada output: Fail starting to output buffer when the output layer is deactivated (#20846)
Fixes php/php-src#20837.
2026-01-10 14:37:52 +01:00
Niels Dossche
c518a6ba8b Merge branch 'PHP-8.5'
* PHP-8.5:
  fastcgi: Fix compile warning wrt safe_read() (#20887)
2026-01-10 10:49:57 +01:00
Niels Dossche
750c220550 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  fastcgi: Fix compile warning wrt safe_read() (#20887)
2026-01-10 10:49:51 +01:00
Niels Dossche
60b1f59081 fastcgi: Fix compile warning wrt safe_read() (#20887)
This shouldn't be const. Fixes the following warning:
```
warning: variable 'hdr' is uninitialized when passed as a const pointer argument here
      [-Wuninitialized-const-pointer]
 1054 |         if (safe_read(req, &hdr, sizeof(fcgi_header)) != sizeof(fcgi_header) ||
      |                             ^~~
```
2026-01-10 10:49:37 +01:00
Niels Dossche
4c9bbaa79d Merge branch 'PHP-8.5'
* PHP-8.5:
  streams/memory: Ensure internal string is NUL terminated (#20812)
2026-01-02 18:03:41 +01:00
Niels Dossche
de1465e5ae Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  streams/memory: Ensure internal string is NUL terminated (#20812)
2026-01-02 18:03:36 +01:00
Niels Dossche
5484ebcc49 streams/memory: Ensure internal string is NUL terminated (#20812)
zend_string_truncate() doesn't put a NUL byte.
2026-01-02 18:03:17 +01:00
Jakub Zelenka
e49be5f8e2 Allow filtered streams to be casted as fd for select
This removes the artificial limitation that is not necessary. The fact
that some streams can have some data buffered is not a problem because
the similar situation is already present for OpenSSL streams where
OpenSSL can internally buffer data for the unprocessed part of the
record.

Closes GH-20540
2026-01-01 20:51:23 +01:00
Daniel Scherzer
daf4d54610 PHP-8.5 is now for PHP 8.5.3-dev 2025-12-30 14:27:29 -08:00
Jakub Zelenka
ab5c2a826a Use long conversion for stream context keepalive int values (#20805)
This is consistent with http and ssl wrappers where int values
are converted in this way.
2025-12-30 22:08:35 +01:00
Jakub Zelenka
c0be847a7e Prevent possible future precedence issues in PHP_SOCKVAL_IS_SET 2025-12-30 18:56:57 +01:00
Calvin Buckley
5726e53b39 PHP 8.4 is now for PHP 8.4.18-dev 2025-12-30 13:07:11 -04:00
Jakub Zelenka
0fd8aae6e8 Fix TCP_KEEPALIVE no inheriting for accepted sockets on MacOS 2025-12-30 16:53:22 +01:00
Jakub Zelenka
9582d8e6d7 Add stream socket keepalive context options
This adds so_keepalive, tcp_keepidle, tcp_keepintvl and tcp_keepcnt
stream socket context options that are used to set their upper case
C macro variants by setsockopt function.

The test requires sockets extension and just tests that the values are
being set. This is because a real test would be slow and difficult to
show that those options really work due to how they work internally.

Closes GH-20381
2025-12-30 16:52:22 +01:00
Niels Dossche
77eedd78ef Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
2025-12-19 19:37:16 +01:00
Niels Dossche
c35224e11c Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
2025-12-19 19:37:11 +01:00
Niels Dossche
0590a34aee Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
2025-12-19 19:36:53 +01:00
Niels Dossche
ee0143887d Fix GH-20352: UAF in php_output_handler_free via re-entrant ob_start() during error deactivation
The problem is that the code is doing `php_output_handler_free` in a loop on the output stack,
but prior to freeing the pointer on the stack in `php_output_handler_free` it calls
`php_output_handler_dtor` which can run user code that reallocates the stack,
resulting in a dangling pointer freed by php_output_handler_free.
Furthermore, OG(active) is set when creating a new output handler, but
the loop is supposed to clean up all handlers, so OG(active) must be
reset as well.

Closes GH-20356.
2025-12-19 19:36:26 +01:00
Saki Takamachi
2ec8c29fda PHP-8.4 is now for PHP 8.4.17-dev 2025-12-03 14:52:20 +09:00
Eric Mann
e10f6d702f PHP-8.3 is now for PHP 8.3.30-dev 2025-12-02 09:05:38 -08:00
Volker Dusch
d8fbe40efb PHP-8.5 is now for PHP 8.5.2-dev 2025-12-02 12:14:28 +01:00
David Carlier
71d11bdb16 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20601: ftp_connect() timeout argument overflow.
2025-11-29 23:06:41 +00:00
David Carlier
227541cb96 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20601: ftp_connect() timeout argument overflow.
2025-11-29 23:06:15 +00:00
David Carlier
1701589884 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20601: ftp_connect() timeout argument overflow.
2025-11-29 23:05:37 +00:00