1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 05:32:28 +02:00
Commit Graph

136508 Commits

Author SHA1 Message Date
Peter Kokot
df6d85acf8 Fix CS for fnmatch check (#14659)
This wraps the check when cross-compiling into AS_* macros and uses the
default description template provided the AC_FUNC_FNMATCH. In such case
the 3rd argument can be omitted. Also, newer Autoconf versions have
replaced backticks with single quotes in AC_DEFINE* macros descriptions.
security-audit-2024
2024-06-25 00:15:54 +02:00
David CARLIER
5c55306a50 Fix GH-14652: segfault on node without document. (#14653)
do not bother trying to clone the inner document if there is none to
begin with.
2024-06-24 22:31:53 +01:00
Peter Kokot
835cb69ab5 Normalize bcmath extension sources (#14655)
Follow-up of GH-14654
2024-06-24 22:51:51 +02:00
Peter Kokot
f3feef8b93 Define default RE2C_FLAGS (#14615)
The --no-generation-date flag is a common re2c flag used in all re2c
invocations. This adds the 2nd optional argument to PHP_PROG_RE2C M4
macro in BC manner to set the default re2c command-line options and sets
the default RE2C_FLAGS similarly on Windows.
2024-06-24 22:09:04 +02:00
Niels Dossche
e4250cec79 Introduce Dom\AdjacentPosition and use it in the insert adjacent methods
See https://wiki.php.net/rfc/dom_additions_84#allowing_php-specific_developer_experience_improvements
2024-06-24 12:36:35 -07:00
Niels Dossche
a068a9a5bb Make XMLDocument::xinclude() return values and error conditions sane
See https://wiki.php.net/rfc/dom_additions_84#api_amendments
2024-06-24 12:36:35 -07:00
Peter Kokot
5236551776 [skip ci] Remove obsolete guideline how to comment out code (#14621)
This can lead to undefined warnings when building with -Wundef and using
undefined FOO macro in #if condition. Also such code disabling should
not be encouraged exactly.
2024-06-24 20:37:42 +02:00
Arnaud Le Blanc
ff58a7f624 Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS for GH-13922
  [ci skip] NEWS for GH-13922
  Support sysconf(_SC_GETPW_R_SIZE_MAX) == -1 (#13922)
2024-06-24 19:57:28 +02:00
Arnaud Le Blanc
e230610c76 [ci skip] NEWS for GH-13922 2024-06-24 19:57:00 +02:00
Arnaud Le Blanc
b1119de0c9 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS for GH-13922
  Support sysconf(_SC_GETPW_R_SIZE_MAX) == -1 (#13922)
2024-06-24 19:56:19 +02:00
Arnaud Le Blanc
d7ef2c209a [ci skip] NEWS for GH-13922 2024-06-24 19:55:47 +02:00
Arnaud Le Blanc
3fbca7fb6a Support sysconf(_SC_GETPW_R_SIZE_MAX) == -1 (#13922) 2024-06-24 19:52:55 +02:00
Peter Kokot
cf3b9fca8f Sync #if/ifdef/defined (-Wundef) (#14623)
These are either define (to value 1) or undefined:
- __GNUC__
- DBA_CDB_BUILTIN
- DBA_GDBM
- HAVE_FORK
- HAVE_PUTENV
- HAVE_SETENV
- HAVE_SYS_SELECT_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_WAIT_H
- HAVE_UNSETENV
- RFC3678_API
- ZEND_ENABLE_ZVAL_LONG64
- ZTS

Follow-up of GH-5526
2024-06-24 19:37:07 +02:00
Arnaud Le Blanc
ab9a0295c5 [ci skip] NEWS for GH-14650 2024-06-24 16:53:11 +02:00
Julien Voisin
e3c9f5a585 Compute the size of pages before allocating memory (#14650)
`start_memory_manager()` calls `zend_mm_init()` via `alloc_globals_ctor()`
before setting `REAL_PAGE_SIZE` to the right value. Moving the `REAL_PAGE_SIZE`
setting block before the call to `alloc_globals_ctor()` makes the allocator
behave properly on systems with a page size different than 4k.

Suggested-by: arnaud-lb
2024-06-24 16:51:18 +02:00
Peter Kokot
3da6377806 Remove DBA_DB1 definition from Windows build (#14649)
The DBA_DB1 is checked with #ifdef and version 1 emulation is present in
DB version 3.
2024-06-24 16:50:22 +02:00
Peter Kokot
ddcd1c86a3 Remove outdated code from mysqli Windows build (#14648)
The --with-mysqli option once accepted the mysqlnd argument when
also libmysql was used.
2024-06-24 14:18:14 +02:00
Peter Kokot
106581b1b6 Remove outdated libs_version.txt file (#14631)
This is not being synced with changes done in github.com/winlibs and
served only for documentation purposes. Since the list is outdated it is
simpler to remove it than maintain it updated.
2024-06-24 00:54:26 +02:00
Peter Kokot
c2f6fa4ee7 Use AC_DEFINE_UNQUOTED where variables are used (#14647)
According to Autoconf documentation AC_DEFINE_UNQUOTED should be used,
where shell variables are used in the macro arguments.
https://www.gnu.org/software/autoconf/manual/autoconf-2.72/autoconf.html#index-AC_005fDEFINE_005fUNQUOTED-2

This also adds simple help descriptions to these CPP macros.
2024-06-23 23:53:50 +02:00
Peter Kokot
fc36d0e849 Sync spl extension dependency for mysqli extension (#14642)
This is configure time dependency for consistency.
2024-06-23 23:15:47 +02:00
David CARLIER
8eb0889d90 Fix GH-14637: memory leak after failed heap allocation due to mem limit. (#14641) 2024-06-23 21:43:02 +01:00
Peter Kokot
c6dc3bd9f8 Remove obsolete enable_pear BC compatibility check (#14636)
This was added due to configure option rename from --enable-pear to
--with-pear:
2cf1b8d345
2024-06-23 21:39:52 +02:00
Peter Kokot
8d876e435b Enable static tsrmls cache in pdo_mysql with mysqlnd (#14634)
The tsrmls cache has been integrated in
aac7b1db7c but not enabled when pdo_mysql
is built for mysqlnd extension.
2024-06-23 21:12:35 +02:00
Peter Kokot
df12ffcc77 Check for library functions on one place in Zend.m4 (#14635)
The m4_normalize is for Autoconf < 2.70 (on 2.70 and later versions a
blank-or-newline separated items can be expanded without using
backslash-newline).
2024-06-23 20:18:53 +02:00
Peter Kokot
0ed134100f Update mysqli and pdo_mysql extension dependencies (#14633)
- The mysqlnd is required dependency in mysqli extension
- When building pdo_mysql with mysqlnd (--with-pdo-mysql or
  --with-pdo-mysql=mysqlnd) mysqlnd is required
- This also adds missing configure time pdo dependency to pdo_mysql
2024-06-23 19:59:31 +02:00
Peter Kokot
678a481f62 Fix unused variable warning when using libpq < 12 (#14630)
The variable S is not used if PQresultMemorySize is not available in
this switch at this point.
2024-06-22 00:09:21 +02:00
Peter Kokot
05f3304b48 Remove unused PHP_PGSQL_API_VERSION (#14629)
The pgsql extension headers aren't installed and this API version hasn't
been used nor bumped yet.
2024-06-21 23:31:20 +02:00
Peter Kokot
338be9dd9c Fix PHP_DEBUG condition in cgi SAPI (#14620)
PHP_DEBUG is always defined, either to 0 or 1. This matches the
fpm_main.c code with similar check even though it was not executed for
a while.
2024-06-21 20:59:34 +02:00
Peter Kokot
f4ce50ddfb Add optional pkg-config support for PostgreSQL library (libpq) (#14540)
The pkg-config (libpq.pc file) was added in PostgreSQL 9.3. This adds a
common setup M4 macro PHP_SETUP_PGSQL to find client PostgreSQL library
libpq on the system with pkg-config. If not found, check falls back to
pg_config to find the libpq and its headers in common locations as
before.

The PGSQL_CFLAGS and PGSQL_LIBS environment variables can override the
libpq installation paths:

    ./configure --with-pgsql --with-pdo-pgsql \
        PGSQL_CFLAGS=-I/path/to/libpq \
        PGSQL_LIBS="-L/path/to/libpq -lpq"

Passing manual, non-standard PostgreSQL installation path can be done
with configure option arguments:

    ./configure \
        --with-pgsql=/any/path/to/postgresql \
        --with-pdo-postgresql=/any/path/to/postgresql

If this DIR argument (PostgreSQL installation directory or path to the
pg_config) is passed, it takes precedence over the pkg-config, when
installed on the system.

This also removes the unused HAVE_LIBPQ symbol and passing the
PGSQL_INCLUDE and PGSQL_LIBDIR environment variable to configure in
favor of PGSQL_CFLAGS and PGSQL_LIBS.

Instead of the obsolete backticks the recommended $(...) is used when
invoking the pg_config.

Follow-up of GH-4235 (Use PKG_CHECK_MODULES to detect the pq library)
2024-06-21 18:35:37 +02:00
Peter Kokot
5d359cd4e5 Remove unused PHP-8.3 generated JIT files (#14622)
This remove unused PHP-8.3 generated JIT files and adds PHP-8.3
generated JIT files back to .gitignore to have smoother workflow
when switching PHP branches this can be ignored for a branch
or two.
2024-06-21 17:33:57 +02:00
Peter Kokot
6e2ad3c4ba Define HAVE_VISIBILITY for fileinfo extension (#14618)
The libmagic library also uses the HAVE_VISIBILITY macro that should be
defined to 1 if visibility is supported or 0 if not.

Follow-up of GH-5526 (-Wundef)
2024-06-21 16:18:28 +02:00
Peter Kokot
b12ccb319f Add PHP_SETUP_ZLIB M4 macro (#14591)
This enables the zlib library (https://zlib.net/) from a single place to
match the minimum required version across the php-src. This provides a
possible simpler version bump in the future. Macro's 2nd and 3rd
arguments can pass additional actions whether zlib library is found or
not for the possible future adjustments in the ext/standard where also
zlib might be required.

Support for pkg-config was introduced in 1.2.3.1.
The minimum zlib version has been bumped to 1.2.3.1



* Bump minimum zlib version to 1.2.11

This is aligned with CentOS 8, which has 1.2.11 in the default packages.

* [skip ci] Move zlib version change to UPGRADING

This matches the OpenSSL style version change notice already done in
this file.
2024-06-21 15:05:34 +02:00
Ayesh Karunaratne
5a6f07e23c UPGRADING: add ext/oci8 and ext/pdo_oci removal to UPGRADING file (#14619)
Fixes [13327-comment](https://github.com/php/php-src/pull/13327#issuecomment-2176327609)

Signed-off-by: Ayesh Karunaratne <ayesh@aye.sh>
2024-06-21 08:45:53 +01:00
David Carlier
c1c29143b5 Merge branch 'PHP-8.3' 2024-06-21 05:08:56 +01:00
David Carlier
04418ede7a Merge branch 'PHP-8.2' into PHP-8.3 2024-06-21 05:08:21 +01:00
David Carlier
686afc10bf Fix GH-14603: invalid null zip file entry.
close GH-14610
2024-06-21 05:07:46 +01:00
David Carlier
6847036fec Merge branch 'PHP-8.3' 2024-06-21 05:04:05 +01:00
David Carlier
19ddb5f92d Merge branch 'PHP-8.2' into PHP-8.3 2024-06-21 05:03:30 +01:00
David Carlier
6704c60589 Fix GH-14596: phpdbg with asan and ZC_RC_DEBUG set crashes.
close GH-14607
2024-06-21 05:02:53 +01:00
Matteo Beccati
5a3c4a2c9c Fix test when using libmysqlclient
TL;DR
When suing libmysqlclient, ints are fetched as strings, so the strict comparison was failing
2024-06-20 13:25:52 +02:00
Peter Kokot
11914de72c Sync ext/dom and unistd.h include style (#14597) 2024-06-19 22:25:20 +02:00
Arnaud Le Blanc
dc477b59e3 [ci skip] NEWS for GH-13432 2024-06-19 19:49:06 +02:00
Florian Engelhardt
f4557b48a6 Add gc and shutdown callbacks to ZendMM custom handlers (#13432) 2024-06-19 19:43:57 +02:00
Tim Düsterhus
a1ea464069 gen_stub: Intern the parameter name string for named arguments in internal attributes (#14595)
This is necessary because `zend_get_attribute_object()` will use the persistent
string with the parameter name as the index for a newly created non-persistent
HashTable, which is not legal.

As parameter names are expected to be short-ish, reasonably common terms and
need to sit around in memory anyways, we might as well make them an interned
string, circumstepping the issue without needing to duplicate the parameter
name into a non-persistent string.
2024-06-19 08:06:50 +02:00
David CARLIER
0c3dd16fbd ext/gd: ownership. (#14601) 2024-06-19 05:49:06 +01:00
Gina Peter Banyard
7a1eded24d ext/soap: Use zend_string for name parameter of set_soap_fault() 2024-06-19 02:23:08 +01:00
Gina Peter Banyard
e1b59e9edd ext/soap: Use more accurate return types in implementations of SoapClient::__doRequest()
The do_request() function that calls this methods, assumes that a string is being returned from the method
otherwise it bails out.

However, the default implementation of SoapClient::__doRequest() indicates that it can return null when it
fails to set-up and execute the HTTP SOAP request, but this always results in a SoapFault exception being
thrown, and thus cannot happen in practice.

We need to investigate further if the return type should be changed from ?string to string or not.
2024-06-19 02:23:08 +01:00
Gina Peter Banyard
0fc5ec108e ext/soap: Add tests for invalid SOAP Headers argument 2024-06-19 02:23:08 +01:00
Gina Peter Banyard
cd61f16ad8 ext/soap: Refactor verify_soap_headers_array()
Make its duty only to check if the provided HashTable is valid
2024-06-19 02:23:08 +01:00
Gina Peter Banyard
e12db87e09 ext/soap: Add some SoapServer tests about handling errors 2024-06-19 02:23:01 +01:00