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

136563 Commits

Author SHA1 Message Date
Niels Dossche
2fc27b7d2a Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14590: Memory leak in FPM test gh13563-conf-bool-env.phpt
2024-06-28 22:10:23 +02:00
Niels Dossche
41371900a8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14590: Memory leak in FPM test gh13563-conf-bool-env.phpt
2024-06-28 22:08:18 +02:00
Niels Dossche
056bec72f4 Fix GH-14590: Memory leak in FPM test gh13563-conf-bool-env.phpt
Values retrieved from zend_getenv should be freed.
Note: The only possible value for `zend_getenv` is `sapi_getenv` which uses
zend alloc to duplicate the string that it reads from the SAPI module.

Closes GH-14708.
2024-06-28 22:05:15 +02:00
David Carlier
532a2604c2 Fix GH-14698: segfault on dom node after dereference.
close GH-14701
2024-06-28 20:52:48 +01:00
Niels Dossche
03dab7ec3d Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] Move incorrectly placed NEWS items to the right place
2024-06-28 20:16:51 +02:00
Niels Dossche
f97e2779b1 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] Move incorrectly placed NEWS items to the right place
2024-06-28 20:16:45 +02:00
Niels Dossche
643762cd78 [ci skip] Move incorrectly placed NEWS items to the right place 2024-06-28 20:16:19 +02:00
Niels Dossche
d883996326 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14537: shmop Windows 11 crashes the process
2024-06-28 20:14:26 +02:00
Niels Dossche
c19affc567 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14537: shmop Windows 11 crashes the process
2024-06-28 20:14:20 +02:00
Niels Dossche
39a3266576 Fix GH-14537: shmop Windows 11 crashes the process
The error handling code isn't entirely right in two places.
One of the code blocks is dead because of an always-false condition, and
another code block is missing the assignment of a NULL pointer.

Getting the exact same behaviour is not entirely possible because you
can't extend the size of a shared memory region after it was made with
the Windows APIs we use, unless we destroy the region and recreate it,
but that has other consequences.
However, it certainly shouldn't crash.

Closes GH-14707.
2024-06-28 20:13:47 +02:00
Niels Dossche
59e639b5d4 Follow-up on GH-13516: include config.h from build dir for new files in ext-dom (#14705)
GH-13516 was created before the new DOM files were added, and the PR was
never rebased to include the new DOM files, so there are three places
which were not replaced.
2024-06-28 18:29:22 +02:00
Máté Kocsis
a2cecd2a6f Remove ZEND_STATIC_ASSERT() calls from legacy arginfo files
After report in 5992a29724 (r143540472)
2024-06-27 21:52:27 +02:00
Peter Kokot
c705dd8884 Wrap FPM checks in AC_CACHE_CHECK and fix CS (#14681)
- This simplifies over-quoted arguments to AC_COMPILE_IFELSE
- Indentation and other CS fixes
- php_cv_* cache variables
- AC_DEFINE help texts syncs to make it more clear
- Fix -Wunused-but-set-variable warnings
2024-06-27 21:30:35 +02:00
Peter Kokot
fd28bb0f51 Normalize ext/standard sources (#14677)
Follow-up of GH-14654
2024-06-27 20:45:09 +02:00
Peter Kokot
11f4683ee5 Wrap __cpuid_count check into ZEND_CHECK_CPUID_COUNT M4 macro (#14692)
Instead of checking this when including the Zend.m4 file in configure.ac
check is executed with the ZEND_INIT macro.
2024-06-27 20:16:40 +02:00
Peter Kokot
c7c02f2abf Wrap global register variables check in M4 macro (#14683)
This adds ZEND_CHECK_GLOBAL_REGISTER_VARIABLES M4 macro to properly
sort the --enable-gcc-global-regs in configure --help output, fixes
over-quoted arguments, syncs CS and updates help texts.
2024-06-27 20:08:03 +02:00
Tim Düsterhus
ac54d1c039 hash: Add simple HashContext::__debugInfo() implementation (#14644)
* hash: Add simply HashContext::__debugInfo() implementation

* NEWS/UPGRADING
2024-06-27 19:29:37 +02:00
Gina Peter Banyard
5b1b3ae673 ext/soap: Initialize a HashTable of size j
The i seems to be a mistake as everything else uses j
2024-06-27 17:41:23 +01:00
Gina Peter Banyard
ee75f344f8 ext/soap: Add const qualifiers for serialize functions
As serializing something should not affect the value of it
2024-06-27 17:41:23 +01:00
Gina Peter Banyard
ca2b131c6e ext/soap: mark string param of sdl_serialize_key() as const
Add const qualifiers to the variables at the call size
Rename variables when they were shadowing a variable from the outer scope
2024-06-27 17:41:23 +01:00
Gina Peter Banyard
325f8f0cfc ext/soap: Remove cast from macro
Move it to the one call site that requires it
2024-06-27 17:41:23 +01:00
Gina Peter Banyard
0e91b4f5e6 ext/soap: convert int type to size_t where appropriate 2024-06-27 17:41:23 +01:00
Gina Peter Banyard
902c8ceab0 ext/soap: Rename MD5 context variable to not shadow the stream context variable 2024-06-27 17:41:23 +01:00
Gina Peter Banyard
26143dae2d ext/soap: Remove unused 'cache' extension global 2024-06-27 17:41:23 +01:00
Peter Kokot
3d6bd16239 Sync missing hash and pcre dependencies for opcache on Windows (#14682)
- ext/hash is required only on Windows
- ext/pcre is required
2024-06-27 18:23:01 +02:00
David CARLIER
54e5e7b507 ext/pdo_pgsql: object initialisation, using smart_str api instead. (#14679) 2024-06-27 05:53:38 +01:00
Peter Kokot
604dafff3a Rename and refactor Zend.m4 macros (#14671)
- LIBZEND_* -> ZEND_*
- A single "public" initialization M4 macro ZEND_INIT that wraps Zend
  engine related configure step checks and initialization.
2024-06-26 22:57:01 +02:00
Peter Kokot
807273e263 Normalize Zend sources (#14676)
Follow-up of GH-14654
2024-06-26 22:18:46 +02:00
Niels Dossche
1501da0bf9 NEWS and UPGRADING for new DOM features RFC 2024-06-26 12:17:12 -07:00
Niels Dossche
48c9f1e2c3 Implement Dom\HTMLElement class 2024-06-26 12:17:12 -07:00
Niels Dossche
78401ba867 Implement Dom\Document::$title setter 2024-06-26 12:17:12 -07:00
Niels Dossche
04af960397 Implement Dom\Document::$title getter 2024-06-26 12:17:12 -07:00
Niels Dossche
a12db3b656 Implement Dom\Document::$body setter 2024-06-26 12:17:12 -07:00
Niels Dossche
287cf91724 Implement Dom\Document::$head 2024-06-26 12:17:12 -07:00
Niels Dossche
a1485df55a Implement Dom\Document::$body getter 2024-06-26 12:17:12 -07:00
Niels Dossche
e7cc819bd9 Merge branch 'PHP-8.3'
* PHP-8.3:
  Add SKIPIFs for upstream regression in libxslt (#14674)
2024-06-26 19:36:08 +02:00
Niels Dossche
4794c1fc16 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add SKIPIFs for upstream regression in libxslt (#14674)
2024-06-26 19:36:01 +02:00
Niels Dossche
5a32b510ef Add SKIPIFs for upstream regression in libxslt (#14674)
See https://gitlab.gnome.org/GNOME/libxslt/-/issues/113
2024-06-26 19:35:52 +02:00
Niels Dossche
3760c9d001 Add SKIPIFs for upstream regression in libxslt (#14674)
See https://gitlab.gnome.org/GNOME/libxslt/-/issues/113
2024-06-26 19:31:21 +02:00
Peter Kokot
8946099b73 Rename AC_FPM_* M4 macros to PHP_FPM_* (#14670)
This syncs the FPM SAPI M4 macro names with the current naming
conventions prefixed with PHP_.
2024-06-26 15:39:52 +02:00
Derick Rethans
9b5c15ba98 Remove superfluous whitespace 2024-06-26 08:06:41 -05:00
Derick Rethans
df7d304b62 Emit opcode for frameless functions at line number where the function call starts 2024-06-26 08:06:41 -05:00
Arnaud Le Blanc
11accb5cdf Preferably include from build dir (#13516)
* Include from build dir first

This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.

Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :

    -I$(top_builddir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/main
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM
    -I$(top_builddir)/

As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.

After this change, the include path is defined as follows:

    -I$(top_builddir)/main
    -I$(top_builddir)
    -I$(top_srcdir)/main
    -I$(top_srcdir)
    -I$(top_builddir)/TSRM
    -I$(top_builddir)/Zend
    -I$(top_srcdir)/Zend
    -I$(top_srcdir)/TSRM

* Fix extension include path for out of tree builds

* Include config.h with the brackets form

`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.

Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
2024-06-26 00:26:43 +02:00
Peter Kokot
604e0a7bbe Fix negation in shell tests (#14662)
According to documentation the `if test ! ...` is preferred to
`if ! test ...`. The later is not portable:
https://www.gnu.org/software/autoconf/manual/autoconf-2.72/autoconf.html
2024-06-25 23:31:08 +02:00
David CARLIER
bc585cd87a Fix GH-14643 ext/standard: segfault on user shutdown function release. (#14656) 2024-06-25 21:13:15 +01:00
Peter Kokot
4f450b6264 Bump minimum libpq version to 10.0 (#14628)
This bumps the libpq client-side PostgreSQL library minimum required
version from 9.1 to 10.0.

- Sanity check: PQlibVersion -> PQencryptPasswordConn (available since
  libpq 10.0)
- PQsetErrorContextVisibility (available since libpq 9.6)
- lo_truncate64 (available since libpq 9.3), if 32-bit system doesn't
  support lo_*64 functions, error is returned and functions are always
  available

Additionally, the conditional functions usages in pdo_pgsql and pgsql
extensions that got piled up are cleaned and synced:

- pg_prepare (PQprepare available since libpq 7.4)
- pg_query_params (PQexecParams available since libpq 7.4)
- pg_result_error_field (PQresultErrorField available since libpq 7.4)
- pg_send_prepare (PQsendPrepare available since libpq 7.4)
- pg_send_query_params (PQsendQueryParams available since libpq 7.4)
- pg_set_error_verbosity (PQsetErrorVerbosity available since libpq 7.4)
- pg_transaction_status (PQtransactionStatus available since libpq 7.4)

The Windows libpq version is currently at version 11.4:
https://github.com/winlibs/postgresql

Discussion: https://news-web.php.net/php.internals/123609
Follow-up of GH-14540
2024-06-25 20:50:04 +02:00
Peter Kokot
909d331d0a Add _GNU_SOURCE definition unconditionally (#14651)
Since Autoconf >= 2.70 the _GNU_SOURCE and some other extensions are
defined unconditionally regardless whether the __EXTENSIONS__ can be
safely defined. Some obsolete Solaris systems once had issues with
compiling a default set of standard system headers when __EXTENSIONS__
was defined. Autoconf 2.69 and earlier checked based on that and defined
the _GNU_SOURCE conditionally. This condition is not relevant on current
systems anymore.
2024-06-25 20:07:42 +02:00
Peter Kokot
3cbf5aa63e Normalize mysqlnd extension sources (#14654)
The m4_normalize() can simplify the list argument. It removes leading
and trailing spaces and tabs, sequences of backslash-then-newline, and
replaces multiple spaces, tabs, and newlines with a single space.
2024-06-25 19:33:51 +02:00
Peter Kokot
0775d68322 Fix configure log message when cross-compiling (#14658)
This puts the configure log into its own lines and makes it readable:

    checking for gcc... gcc
    checking for native build C compiler... gcc
2024-06-25 18:58:53 +02:00
Peter Kokot
5db847e313 Fix --enable-re2c-cgoto check (#11928)
When the computed goto extension is available to optimize conditional
jumps, option --enable-re2c-cgoto adds the -g flag to re2c.

In this case the AC_LANG_SOURCE is used instead of the AC_LANG_PROG to
not wrap the compilation check program in another main() function. Code
is also simplified and help messages updated. This is a
compiler-agnostic extension, not only available with GCC.

When the check is successful, the -g is added, otherwise not.
2024-06-25 16:10:10 +02:00