Commit graph

137134 commits

Author SHA1 Message Date
Niels Dossche
76ad89ccff
Fix GH-15192: Segmentation fault in dom extension (html5_serializer)
When cloning a document, doc will not be equal to the actual new
document clone->doc. clone->doc will always point to the correct
document so use that instead when comparing document nodes.

Closes GH-15198.
2024-08-02 18:22:17 +02:00
Ilija Tovilo
85fa983fe6
Add ReflectionProperty::getSettableType() test for get-only backed property
Fix test name while we're at it.
2024-08-02 17:48:08 +02:00
Ilija Tovilo
2e9cc9bc30
Allow optimizer to depend on preloaded symbols (#15021)
* Allow optimizer to depend on preloaded symbols

It is safe for the optimizer to rely on preloaded symbols. This can occur when
compiling non-preloaded files, referencing preloaded ones.

* Disable inline pass for observer test

* Move duplicated code into functions

* Add comment to specific optimization value

* Optimizer should only rely on preloaded symbols in the symbol table

* Fix skipif for windows
2024-08-02 17:35:27 +02:00
Remi Collet
521178709e
use libedit instead of readline for CI 2024-08-02 14:34:42 +02:00
Peter Kokot
9467ffb43c
Autotools: Remove obsolete config.status invocations (#15185)
This was once added to fix the bug https://bugs.php.net/13561 because
the phpize and php-config scripts were located in the pear subdirectory
and were installed only when --with-pear option was used. Then in the
20c43285f7 scripts were moved to scripts
subdirectory with this mechanism used in the generated Makefile when
running 'make install' command.

Before the AC_CONFIG_FILES was introduced to Autoconf AC_OUTPUT once
accepted arguments. This signature is obsolete in current Autoconf
versions.

The old obsolete config.status invocation:
  CONFIG_FILES=... ./config.status

And the new invocation is (if used with AC_CONFIG_FILES in the code):
  ./config.status --file=...

Instead, this simply removes the redundant phpize and php-config
generation with the old obsolete config.status invocations as these
files are always generated in the php-src build context.
2024-08-02 12:35:11 +02:00
Peter Kokot
0339d8c589
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13199: Redundant prompt in phpdbg with libedit/readline
2024-08-02 08:38:35 +02:00
Peter Kokot
97049b44bd
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13199: Redundant prompt in phpdbg with libedit/readline
2024-08-02 08:37:35 +02:00
Peter Kokot
dc670cb7f6
Fix GH-13199: Redundant prompt in phpdbg with libedit/readline
When using libedit/readline integration in phpdbg:

    ./configure --with-libedit --enable-phpdbg-readline

EOF makes editline write prompt again in local console mode. For
example, this can be noticed when reading phpt test files from STDIN and
running phpdbg:

    ./sapi/cli/php run-tests.php sapi/phpdbg

Closes GH-13199
2024-08-02 08:33:57 +02:00
Peter Kokot
48916cec33
Sync file permissions
Git can track executable (0755) and non-executable (0644) file modes.
This is a minor file permissions sync for the win32/build/mkico.sh
(0755).

[skip ci]
2024-08-02 02:39:52 +02:00
Peter Kokot
f66feaec0f
Sync HAVE_<extension> help texts (#15167)
This syncs all help texts of extension preprocessor macros to the same
style "Define to 1 if the PHP extension '<ext>' is available.".
[skip ci]
2024-08-02 01:41:47 +02:00
Peter Kokot
4993453933
Autotools: Update configure.ac CPP macros help texts (#15189)
- __MUSL__
- DEFAULT_SHORT_OPEN_TAG
- HAVE_BUILD_DEFS_H
- HAVE_GCOV
- HAVE_LIBDL
- PHP_RTLD_NOW
- PHP_SIGCHILD
- ZEND_FIBER_UCONTEXT
2024-08-02 01:14:48 +02:00
Peter Kokot
079f82a8ec
Sync CPP macros in ext/iconv (#15191)
This syncs and adds help texts for CPP macros defined when iconv
extension is configured.
2024-08-02 00:49:18 +02:00
Peter Kokot
eed66e6183
Autotools: Fix ffi checks (#15197)
When libffi is installed on non-default places, also the calling
convention checks need adjusted compilation flags to be able to find the
ffi.h header file.
2024-08-02 00:32:36 +02:00
David Carlier
3c36c7308d
sapi/phpdbg: windows update exception type falling into segfault.
close GH-15098
2024-08-01 11:49:13 +01:00
Peter Kokot
1ca3230966
Autotools: Update php.m4 CPP macros help texts (#15188)
- COMPILE_DL_<extension>
- COOKIE_SEEKER_USES_OFF64_T
- HAVE_BROKEN_GETCWD
- HAVE_LIBEXPAT
- HAVE_PREAD
- HAVE_PWRITE
- MISSING_ASCTIME_R_DECL
- MISSING_CTIME_R_DECL
- MISSING_GMTIME_R_DECL
- MISSING_LOCALTIME_R_DECL
- MISSING_STRTOK_R_DECL
- PHP_PREAD_64
- PHP_PWRITE_64
- SIZEOF_<type>
- HAVE_<type>
2024-08-01 10:08:28 +02:00
Saki Takamachi
0f2f7c6fb4
[skip ci] Update NEWS for PHP 8.4.0alpha4 2024-08-01 09:41:27 +09:00
Peter Kokot
28a7c6243c
[skip ci] Add HAVE_XSL_EXSLT help text (#15174) 2024-08-01 00:46:20 +02:00
Peter Kokot
c96f08aa70
Autotools: Normalize PHP_OUTPUT arguments (#15177)
The m4_normalize([$1]) normalizes items into a single-space-separated
list of files to append them to the global PHP_OUTPUT_FILES variable
that is processed by AC_CONFIG_FILES. Redundant newlines are also
removed in the generated configure script.

PHP extensions using phpize can't use this macro so it's safe to change
this.
2024-08-01 00:14:56 +02:00
Tim Düsterhus
a578c27a51
Improve link styling in PHPInfo (#15077)
* Improve link styling in PHPInfo

The previous styling with the fixed background color didn't work well in dark
mode. Remove the background and make links inherit the regular text color. To
make them visually detectable the underlining behavior is reversed. The
underline is now shown when not hovering and hidden when hovering.

* Preserve the headline linking behavior
2024-07-31 12:10:16 +02:00
David CARLIER
b7e43bd2b7
ext/readline: readline_info fix usage when the buffer is not initialised (#15139)
rl_initialise is only called when readline() is used so the global
 buffer might not be initialised yet.
2024-07-31 11:04:44 +01:00
Niels Dossche
3c68661ec9
Minor cleanup in dom_character_data_append_data (#15173) 2024-07-30 23:05:12 +02:00
Niels Dossche
ceca599649
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix UAF when removing doctype and using foreach iteration
2024-07-30 20:07:48 +02:00
Niels Dossche
4049594adf
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix UAF when removing doctype and using foreach iteration
2024-07-30 20:03:30 +02:00
Niels Dossche
b282dd749f
Fix UAF when removing doctype and using foreach iteration
This is an old bug, but this is pretty easy to fix.
It's basically applying the same fix as I did for e878b9f.
Reported by YuanchengJiang.

Closes GH-15143.
2024-07-30 20:01:22 +02:00
Saki Takamachi
60afeb5537
RFC: Change GMP bool cast behavior (#15151)
Implementation of "RFC: Change GMP bool cast behavior"

https://wiki.php.net/rfc/fix_up_bcmath_number_class

Co-authored-by: Tim Düsterhus <tim@bastelstu.be>
2024-07-31 00:41:49 +09:00
Saki Takamachi
0e33b8dad9
Update NEWS for PHP 8.4.0alpha3 2024-07-30 22:09:31 +09:00
Arnaud Le Blanc
c7b65508d3
[ci skip] NEWS 2024-07-30 15:03:21 +02:00
Arnaud Le Blanc
03149ef962
Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS
  [ci skip] NEWS
  Fix destruction of generator running in fibers during shutdown (#15158)
2024-07-30 14:59:24 +02:00
Arnaud Le Blanc
e077186a34
[ci skip] NEWS 2024-07-30 14:59:01 +02:00
Arnaud Le Blanc
e24101acb4
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [ci skip] NEWS
  Fix destruction of generator running in fibers during shutdown (#15158)
2024-07-30 14:56:28 +02:00
Arnaud Le Blanc
58cf903a10
[ci skip] NEWS 2024-07-30 14:55:33 +02:00
Arnaud Le Blanc
99e0d3fe09
Fix destruction of generator running in fibers during shutdown (#15158)
The destructor of generators is a no-op when the generator is running in a fiber,
because the fiber may resume the generator. Normally the destructor
is not called in this case, but this can happen during shutdown.

We detect that a generator is running in a fiber with the
ZEND_GENERATOR_IN_FIBER flag.

This change fixes two cases not handled by this mechanism:

- The ZEND_GENERATOR_IN_FIBER flag was not added when resuming a "yield from $nonGenerator"

- When a generator that is running in a fiber has multiple children (aka multiple generators yielding from it), all of them could be considered to also run in a fiber (only one actually is), and could leak if not destroyed before shutdown.
2024-07-30 14:53:19 +02:00
Peter Kokot
79af1b5280
Autotools: Remove unused variable FREETYPE2_FOUND
Follow-up of 19d8a6b771.
2024-07-30 11:25:24 +02:00
Peter Kokot
8356dadb59
Autotools: Fix xml extension dependency (#15162)
The PHP_ADD_EXTENSION_DEP Autoconf macro needs to be called after
PHP_NEW_EXTENSION to be fully effective. This simplifies the code and
checks. Also, due to the current order_by_dep.awk script implementation
it needs to be on its own line with arguments unquoted so that awk can
parse the config.m4 file. Until order_by_dep.awk script is fixed.
2024-07-30 09:17:11 +02:00
Peter Kokot
0970fd439a
Autotools: Sync CS in enchant extension 2024-07-30 07:54:32 +02:00
Peter Kokot
8c18ae7899
Autotools: Sync CS in bz2 extension (#15163)
- AS_* macros used
- Checking message refactored
2024-07-30 07:52:48 +02:00
Peter Kokot
49a08d5ca3
Autotools: Move HAVE_DTRACE to configure.ac (#15160)
Following 32210ce967 and
9ea290b72b, this moves the HAVE_DTRACE
preprocessor macro definition back to configure.ac so that
PHP_INIT_DTRACE Autoconf macro can be used in extensions without
redefinition interference.
2024-07-30 07:47:11 +02:00
Peter Kokot
4d46f26327
Autotools: Update skeleton extension config.m4 template (#15147)
- Comments refactored to a bit more guide way
- Basic help text added to the HAVE_<EXTENSION>* preprocessor macro definitions
- Raw shell ifs replaced with AS_VAR_IF M4 macros
- Code wrapped inside the line length of 80 characters
- pkg-config functionality added on top
- non-pkg-config functionality added afterwards
- The loop refactored a bit with a break and check message done
  afterwards

[skip ci]
2024-07-30 00:48:19 +02:00
Tim Düsterhus
9083ce4d27
[skip ci] Add missing name in NEWS for GH-15121 2024-07-29 19:40:11 +02:00
Dmitry Stogov
53b329e278
Fix GH-15101: _ir_RSTORE: Assertion `ctx->control' (#15153) 2024-07-29 19:17:25 +03:00
Saki Takamachi
28080dce62
round(): Corrected test name and fixed UPGRADING (#14943)
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2024-07-29 20:39:35 +09:00
Peter Kokot
7fd54f9d12
Remove duplicate ZEND_ENABLE_STATIC_TSRMLS_CACHE flag (#15080) 2024-07-29 10:17:23 +02:00
Peter Kokot
9ea290b72b
Sync HAVE_ICONV preprocessor macro usage (#15148)
HAVE_ICONV marks that PHP extension 'iconv' is available, and not only
that iconv library or its functions/headers are available.
2024-07-29 10:12:57 +02:00
Peter Kokot
7d927075ea
Autotools: Sync shared argument CS (#15141)
The 3rd argument of the PHP_NEW_EXTENSION can be "shared" or "yes" to
mark the extension as shared, or anything else to mark that extension as
not shared. This syncs the argument values across the build system to be
"no" as in other always-enabled extensions.
2024-07-29 10:12:32 +02:00
Peter Kokot
575efc0617
Autotools: Quote PHP_ADD_SOURCES* macros arguments (#15146)
- A redundant shell quoted flags argument replaced with Autoconf quotes
  (the PHP_ADD_SOURCES macro already adds the necessary shell quotes
  characters where needed)
- CS synced
2024-07-29 10:08:48 +02:00
Peter Kokot
9cc63e1de9
Autotools: Normalize headers arguments (#15149)
Refactor all "long" arguments into blank-or-newline-separated list of
files with m4_normalize.
2024-07-29 10:08:17 +02:00
Peter Kokot
f3c48f1acd
Autotools: Append hash and opcache build directories (#15132)
When building in out-of-source directory, instead of creating these
build directories right away, this appends them to the list and creates
them at the end of configure phase. These don't need to be created
immediately as no files are generated in these extensions before the
configure phase is finished.

Also, the PHP_ADD_BUILD_DIR is moved after the PHP_NEW_EXTENSION when
the more common $ext_builddir variable is available (the ext/<extension>
isn't available when building with phpize).
2024-07-29 10:02:11 +02:00
Peter Kokot
1ceadaed52
Autotools: Normalize and quote all PHP_NEW_EXTENSION arguments (#15144)
This adds Autoconf quote characters to all PHP_NEW_EXTENSION arguments
and syncs the CS across the php-src Autotools build system.
2024-07-29 00:14:59 +02:00
Peter Kokot
f0788da6b6
Merge branch 'PHP-8.3'
* PHP-8.3:
  [skip ci] Sync CODEOWNERS (#15017)
2024-07-29 00:12:42 +02:00
Peter Kokot
9cd0484de0
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Sync CODEOWNERS (#15017)
2024-07-29 00:12:31 +02:00