Commit Graph

136881 Commits

Author SHA1 Message Date
Ilija Tovilo
a26ec58fa1
De-duplicate readonly property modification error message (#14972) 2024-07-16 16:29:40 +02:00
Tim Düsterhus
551038bb16
zend_compile: Fully remove ZEND_DIM_ALTERNATIVE_SYNTAX (#14974)
This flag is longer set since the merge of property hooks in
780a8280d2. This patch removes it completely,
because the corresponding error messages are unreachable.
2024-07-16 16:27:46 +02:00
Eric Mann
a4c867e8cf
Merge branch 'PHP-8.3' 2024-07-16 06:58:03 -07:00
Eric Mann
155e89e12f
PHP-8.3 is now for PHP 8.3.11-dev 2024-07-16 06:45:20 -07:00
Ayesh Karunaratne
e7c16d2a6a
Build/Windows: Update the Windows icon as svg and build derivatives from it
Co-Authored-By: Nurudin Imsirovic <realnurudinimsirovic@gmail.com>

Closes GH-14964.
2024-07-16 14:47:31 +02:00
Ilija Tovilo
aa006f1cf6
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix use-after-free in property coercion with __toString()
2024-07-16 12:44:01 +02:00
Ilija Tovilo
aca2322801
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix use-after-free in property coercion with __toString()
2024-07-16 12:43:29 +02:00
Ilija Tovilo
8c312ba74b
Fix use-after-free in property coercion with __toString()
This was only partially fixed in PHP-8.3. Backports and fixes the case for both
initialized and uninitialized property writes.

Fixes GH-14969
Closes GH-14971
2024-07-16 12:40:14 +02:00
Ilija Tovilo
7e022ea056
Avoid duplicate code in zend_std_write_property() (#14966) 2024-07-16 12:08:46 +02:00
Peter Kokot
a2bc783815
Autotools: Add missing sigil in AC_CASE and fix Autoconf syntax (#14967) 2024-07-16 08:55:22 +02:00
Peter Kokot
ccd2787947
[skip ci] Update PHP version in phpdbg help (#14965) 2024-07-16 07:02:05 +02:00
Peter Kokot
9c84d24706
[skip ci] Update UPGRADING.INTERNALS
Related to GH-14963
2024-07-16 00:42:16 +02:00
Calvin Buckley
6635948b7a
Check for iODBC and unixODBC with pkg-config in PDO_ODBC (#14963)
* Check for iODBC and unixODBC with pkg-config in PDO_ODBC

PDO_ODBC required that these backends had their path specified manually,
which was clumsy and contrary to how procedural ODBC checked it. This
adds a pkg-config based path to check for these backends that ignores
the 'dir' part of the flag, so i.e. --with-pdo-odbc=unixODBC should pick
it up from the correct location.

Generic and the special ibm-db2 usecase should be unaffected. The header
situation is unfortunately ugly, and has a workaround; this should also
be cleaned up.

* Move check for valid headers to after

* Use existing CFLAGS for PDO_ODBC header check

...instead of a separate funny variable. It does mean we have to save
and restore the value of CPPFLAGS, as AC_CHECK_HEADERS and friends rely
on that variable instead of CFLAGS.

Co-authored-by: Peter Kokot <peterkokot@gmail.com>

* Move PDO_ODBC_TYPE to AC_DEFINE, simplify CFLAGS handling

The variable PDO_ODBC_INCLUDE becomes redundant, as is the CFLAGS
override for PHP_NEW_EXTENSION if we call PHP_EVAL_INCLINE in the
generic case.

Co-authored-by: Peter Kokot <peterkokot@gmail.com>

* Use same variable names so evals can be combined

* Fix identation

* Suggested shell syntax cleanups

---------

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-07-16 00:40:02 +02:00
Niels Dossche
7b3d7c6338
[ci skip] NEWS for return type change in ext/standard
See 673b4e890c
2024-07-15 23:22:49 +02:00
Ayesh Karunaratne
673b4e890c
ext/standard: change highlight_string()/print_r stub return type from string|bool to string|true (#14959)
* ext/standard: change `highlight_string()` return type from `string|bool` to `string|true`

* ext/standard: change `print_r` return type from `string|bool` to `string|true`
2024-07-15 23:20:32 +02:00
Ilija Tovilo
913157f71f
Extract obtaining of fake scope into function (#14960) 2024-07-15 20:00:15 +02:00
Peter Kokot
694e04499a
Autotools: Sync LIBS and LDFLAGS handling (#14956)
- ZEND_EXTRA_LIBS holds all possible libraries appended during the
  checks related to Zend.m4, moved after the ZEND_INIT check to make it
  more clear, redundant double quotes removed;
- EXTRA_LIBS has already been populated above in the configure.ac
- redundant 'unset LIBS' removed
2024-07-15 12:16:53 +02:00
Niels Dossche
6980eba863
Support templated content
The template element in HTML 5 is special in the sense that it does not
add its contents into the DOM tree, but instead keeps them in a separate
shadow DOM document fragment. Interacting with the DOM tree cannot touch
the elements in the document fragment.

Closes GH-14906.
2024-07-15 11:10:51 +02:00
Niels Dossche
8ad5c64393
Refactor XML serializer such that passing context is easier 2024-07-15 11:02:53 +02:00
Niels Dossche
4ef7539144
Split off private data from the ns mapper 2024-07-15 11:02:52 +02:00
Jorg Adam Sowa
85b7181d7d
Added property hooks words in fuzzer parser dict (#14958) 2024-07-14 22:52:25 +02:00
Peter Kokot
1fe854ebfa
Autotools: Sync quotes in PHP_INSTALL_HEADERS
Follow-up of GH-13213

[skip ci]
2024-07-14 22:16:48 +02:00
Peter Kokot
8e8dc40765
Fix #78757: Enhance sendmail log notice (#14955)
The sendmail is set to default value of /usr/sbin/sendmail if not found
on the host system. This was already properly fixed via GH-5548
(commit 517431892b). This change now
also outputs "no" when searching for sendmail and a minimalistic notice
that default send_mail INI directive has been set to /usr/sbin/sendmail.

Fixes and closes: https://bugs.php.net/78757
2024-07-14 22:00:43 +02:00
Peter Kokot
47d3ce4545
Autotools: Quote RE2C_FLAGS argument (#14950)
This enables and simplifies adding blank-or-newline-separated global
re2c flags to the PHP_PROG_RE2C macro possibly at some point. Fixed just
in case, so this works normally:

    PHP_PROG_RE2C([1.0.3], [--no-generation-date -W -foo])
2024-07-14 20:38:57 +02:00
Ilija Tovilo
20d8151b35
Add cachegrind support for php-cgi warmups (#14952)
Cachegrind supports cg_annotate --diff, which makes it much easier to compare
the performance of two patches.

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-07-14 19:53:16 +02:00
Peter Kokot
0051b73a3e
Autotools: Refactor PHP-FPM /proc/pid filename check (#14949)
- Check wrapped in AC_CACHE_CHECK using php_cv_file_proc_mem variable
- CS synced
2024-07-14 17:20:41 +02:00
Peter Kokot
0e2e8e0f13
Autotools: Quote all PHP_ADD_BUILD_DIR arguments (#14947)
- All arguments quoted for consistency
- m4_normalize used where list of directories becomes a bit simpler to
  read and see the diff
2024-07-14 16:58:43 +02:00
Christoph M. Becker
82fe4a2d48
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix skip condition of gh13082.phpt
2024-07-14 13:40:38 +02:00
Christoph M. Becker
02a60be24d
Fix skip condition of gh13082.phpt
The test failure is not particularly related to Travis, but rather is
caused by the GD font file to only be suitable for platforms where
`int` stores 32bit values in little endian byte order.  This platform
dependence is documented in the source code[1].  Thus we fix the skip
condition and skip reason accordingly.

An alternative would be to dynamically create the font file just before
running the test, but that appears to be overkill.

[1] <d59691c02f/ext/gd/gd.c (L545-L556)>

Closes GH-14922.
2024-07-14 13:39:49 +02:00
Ilija Tovilo
e38d5107ec
[skip ci] Fix NEWS entry 2024-07-14 13:39:10 +02:00
Ilija Tovilo
a0c42df4f9
[skip ci] Add property hooks entry to NEWS 2024-07-14 13:37:55 +02:00
Ilija Tovilo
f7649dc103
[skip ci] Fix duplicate core header in NEWS 2024-07-14 13:36:45 +02:00
Christoph M. Becker
a6d1844446
Merge branch 'PHP-8.3'
* PHP-8.3:
  Add test case for GH-13774
2024-07-14 12:48:22 +02:00
Christoph M. Becker
0ed956dc69
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Add test case for GH-13774
2024-07-14 12:47:25 +02:00
Christoph M. Becker
6d0db52896
Add test case for GH-13774
Besides demonstrating the new behavior, this test also ensures that the
bundled and external libgd now behave the same.  It has to be noted,
though, that we only test one of the five code paths.

Closes GH-14945.
2024-07-14 12:46:37 +02:00
Ilija Tovilo
780a8280d2
[RFC] Property hooks (#13455)
RFC: https://wiki.php.net/rfc/property-hooks

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2024-07-14 11:55:03 +02:00
Peter Kokot
09d61b6368
Autotools: Refactor curl config.m4 (#14948)
- CS synced
- When checking for libcurl linked against old OpenSSL the LIBS can be
  used instead of LDFLAGS to put -lcurl to proper place. Also, flags
  manipulation variables are wrapped in the AC_CACHE_CHECK commands
  because there is also OpenSSL setup done later in the code which
  changes LDFLAGS, LIBS and/or CFLAGS.
- CFLAGS added to the check to have edge case of -I flags of custom
  installation paths taken into consideration
- All macro arguments quoted
- SSL check simplified a bit
- The HAVE_CURL symbol help text synced
2024-07-14 03:55:23 +02:00
Peter Kokot
35f64bb5e1
Autotools: Trim redundant newlines in PHP_ADD_BUILD_DIR (#14946)
This reduces redundant newlines in the generated configure script while
keeping possible 'dnl' usage before or after this macro call working as
before (backwards compatible).
2024-07-14 00:07:51 +02:00
Peter Kokot
808d5b3047
[ci skip] Add note about --with-openssl-legacy-provider
Added here to have all build system configuration options changes also
at one place for easier overview.

Option added via GH-13951
2024-07-13 23:21:45 +02:00
Peter Kokot
31a21bb0a1
Make ext/fileinfo/generate_patch.sh simpler to use (#14941)
- Shebang added so it can be called with ./generate_patch.sh
- Script changes its working directory to ext/fileinfo (where it is
  located) so it can be also called as ./ext/fileinfo/generate_patch.sh
- Syntax adjusted a bit for using Bourne or a compatible shell (/bin/sh)
- Downloaded files added to .gitignore
2024-07-13 22:38:43 +02:00
David Carlier
79c134a6e8
Merge branch 'PHP-8.3' 2024-07-13 17:00:53 +01:00
David Carlier
10a94f846d
Merge branch 'PHP-8.2' into PHP-8.3 2024-07-13 16:59:30 +01:00
Denis Ryabov
b456ae8d34
Restore Warning instead of Fatal Error in gd_webp.c
According to the docs (https://www.php.net/manual/en/function.imagecreatefromwebp.php and https://www.php.net/manual/en/function.imagewebp.php), `false` should be returned on errors (similar to other functions of the `gd` extension), but actually all errors result in a `Fatal Error`. It doesn't look normal when trying to read an empty file or a file in the wrong format causes the program to stop. The problem seems to be related to a mega-patch that replaced `zend_error` with `zend_error_noreturn` almost everywhere. My patch fixes this behavior by switching from `zend_error_noerror` to `gd_error` (i.e. to `E_WARNING` level). All necessary memory cleanup is already in the code (as it was before the "zend_error_noreturn" patch).

Close GH-13774
2024-07-13 16:58:54 +01:00
Peter Kokot
520787bb93
Autotools: Refactor PDO_ODBC_CHECK_HEADER (#14935)
- Macro renamed to PHP_PDO_ODBC_CHECK_HEADER
- AC_DEFINE_UNQUOTED used instead of PHP_DEF_HAVE
- help texts added to CPP macro definitions
- CS synced a bit
2024-07-13 06:52:25 +02:00
Peter Kokot
1ee4bf1c5f
Autotools: Use LIBS for appending -lonig (#14936)
LDFLAGS is by convention used more for linker options like -s and -L.
The -l option should go to LIBS instead. This does the same check but
is more understandable in the logs and M4 code.
2024-07-13 06:37:58 +02:00
Peter Kokot
fb5d64c300
Autotools: Use FPM_EXTRA_LIBS for SELinux library (#14885)
Instead of appending -lselinux to global LIBS variable, this adds it as
needed only to FPM_EXTRA_LIBS as it was already used in the BUILD_FPM
invocation.

Follow-up of GH-14881
2024-07-13 01:20:44 +02:00
Peter Kokot
2ea79c024c
Autotools: Use FPM_EXTRA_LIBS for apparmor library (#14884)
Instead of appending -lapparmor to global LIBS variable, this adds it as
needed only to FPM_EXTRA_LIBS as it was already used in the BUILD_FPM
invocation.

Follow-up of GH-14881
2024-07-13 01:20:05 +02:00
Peter Kokot
3dd0c11cc3
Autotools: Use FPM_EXTRA_LIBS for systemd library (#14883)
Instead of appending -lsystemd to global LIBS variable, this adds it as
needed only to FPM_EXTRA_LIBS as it was already used in the BUILD_FPM
invocation. Move php_fpm_systemd substitution after its check.

Follow-up of GH-14881
2024-07-13 01:19:16 +02:00
Niels Dossche
1a07bb9252
Fix GH-14873: PHP 8.4 min function fails on typed integer
The problem is that this line in the VM: `ZVAL_NULL(result);` changes the type
of arg1 as well, because after the DFA pass the result and input both use
CV0($result).
We should not contract assignments with CVs in frameless calls with
arguments.
An older attempt is found at GH-14876 that tried to modify the VM/JIT.

Closes GH-14903.
2024-07-13 00:29:09 +02:00
Peter Kokot
8fe127a55e
Autotools: Enhance PHP_EVAL_LIBLINE M4 macro (#14924)
PHP_EVAL_LIBALINE macro processes the given libraries flags (-l) and/or
library paths flags (-L) and appends the -l flags to either LIBS or the
given *_SHARED_LIBADD variables. The -L flags are appended to the
LDFLAGS. The new 3rd argument enables appending libraries to the given
variable in the 2nd argument without manual setting whether the
extension is shared. For example, to simplify usage in SAPIs where
additional libraries need to be appended but they shouldn't go to the
global LIBS. This can be then used in PHP-FPM SAPI to link apparmor,
SELinux, systemd, etc.
2024-07-12 23:48:36 +02:00