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

133069 Commits

Author SHA1 Message Date
Jakub Zelenka
10e16347ef Format UPGRADING 2023-08-28 11:40:03 +01:00
Jakub Zelenka
aff46d75e1 Fix GH-11982: str_getcsv returns null byte for unterminated quoted string
Closes GH-12047
2023-08-28 11:28:34 +01:00
Bob Weinand
b07a2d4714 Address CR comments
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-08-28 01:25:12 +02:00
Bob Weinand
cd53ce838a Track HashTableIterators for copy-on-write copies of HashTables
When executing a foreach ($ht as &$ref), foreach calls zend_hash_iterator_pos_ex() on every iteration. If the HashTable contained in the $ht variable is not the tracked HashTable, it will reset the position to the internal array pointer of the array currently in $ht.
This behaviour is generally fine, but undesirable for copy-on-write copies of the iterated HashTable. This may trivially occur when the iterated over HashTable is assigned to some variable, then the iterated over variable modified, leading to array separation, changing the HashTable pointer in the variable. Thus foreach happily restarting iteration.
This behaviour (despite existing since PHP 7.0) is considered a bug, if not only for the behaviour being unexpected to the user, also copy-on-write should not have trivially observable side-effects by mere assignment.

The bugfix consists of duplicating HashTableIterators whenever zend_array_dup() is called (the primitive used on array separation).
When a further access to the HashPosition through the HashTableIterators API happens and the HashTable does not match the tracked one, all the duplicates (which are tracked by single linked list) are searched for the wanted HashTable. If found, the HashTableIterator is replaced by the found copy and all other copies are removed.
This ensures that we always end up tracking the correct HashTable.

Fixes GH-11244.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-08-28 01:25:12 +02:00
Niels Dossche
26d6bb3627 Remove useless duplicated call to php_stream_parse_fopen_modes (#12059) 2023-08-27 17:22:23 +02:00
Máté Kocsis
c934e24197 Fix GH-9967 Add support for generating custom function, class const, and property attributes in stubs 2023-08-26 21:35:31 +02:00
Ilija Tovilo
5ad658bc5e Fix type macros for C++
They are now used in arginfo files.
2023-08-26 21:35:31 +02:00
Jakub Zelenka
99a222cd80 FPM tester FastCGI client transport (#11764)
This improves FastCGI client by separating transport functions and adding support for more low level socket transport that is useful for debugging in some cases.

In addition to that it introduces an option for delaying of fcgi request writing.
2023-08-26 19:03:59 +01:00
Niels Dossche
b365fbd014 Merge branch 'PHP-8.2'
* PHP-8.2:
  Add missing EXTENSIONS section to DOM tests
2023-08-26 18:42:29 +02:00
Niels Dossche
ab2cc6e50e Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Add missing EXTENSIONS section to DOM tests
2023-08-26 18:40:02 +02:00
Niels Dossche
bffc74474b Add missing EXTENSIONS section to DOM tests 2023-08-26 18:37:42 +02:00
David CARLIER
69f6c742d8 zend_call_stack_default_size update BSD values. (#12051) 2023-08-26 16:36:02 +01:00
Mikhail Galanin
418cdc0bea Set CLOEXEC on listened/accepted sockets in the FPM children
Closes GH-11708

Co-authored-by: Jakub Zelenka <bukka@php.net>
2023-08-26 15:19:03 +01:00
David CARLIER
e648d39e3b libxml set error structure simplification proposal (#12054) 2023-08-26 12:11:50 +01:00
Jorg Adam Sowa
58ae26a2a7 Fix round() tests for different modes (#12049)
* Fix tests round() with different modes

* Fix test results for  round() with different modes
2023-08-26 10:16:00 +01:00
Alex Dowad
81faab9235 Improve mb_detect_encoding accuracy for text containing vowels with macrons
Among other world languages, the Māori language commonly uses vowels
with macrons.
2023-08-25 12:09:55 +02:00
Marcus Bointon
d7eb4cfdb2 [ci skip] Add note about ReflectionProperty::setValue() signature deprecation to upgrade guide (#12036) 2023-08-24 23:18:19 +01:00
Kamil Tekiela
649872f105 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix param name in implode() error message
2023-08-24 21:07:50 +01:00
Kamil Tekiela
ec82927d25 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix param name in implode() error message
2023-08-24 21:07:18 +01:00
Kamil Tekiela
b1ce1d1f21 Fix param name in implode() error message 2023-08-24 21:05:26 +01:00
Niels Dossche
e1cb721679 Improve warning when returning null from the resolver set by libxml_set_external_entity_loader
Fixes GH-11952.
Closes GH-12022.
2023-08-24 21:23:29 +02:00
ju1ius
3e0e7e3f90 releases property attributes of internal classes (#11980)
* adds test case for internal class property attribute

* releases property attributes of internal classes
2023-08-24 16:07:00 +02:00
HypeMC
f25474f7f2 Add before_needle argument to strrchr()
Closes GH-11430
2023-08-24 14:26:46 +01:00
David CARLIER
9eb032bdcb [ci skip] Adding missing SO_ATTACH_REUSEPORT_CBPF tangential constants (#12042) 2023-08-24 13:52:56 +01:00
Jakub Zelenka
53aa53f42f Introduce Zend guard recursion protection
This PR introduces a new way of recursion protection in JSON, var_dump
and friends. It fixes issue in master for __debugInfo and also improves
perf for jsonSerializable in some cases. More info can be found in
GH-10020.

Closes GH-11812
2023-08-24 13:03:14 +01:00
Alex Dowad
fd462b1e0f Print host CPU and installed package info in CI build log on Linux
On one of the nightly CI builds last week, there were test failures in
mbstring which appear like they might be related to SIMD-accelerated
code. The function which failed testing has multiple implementations,
and the specific implementation which is used depends on the features of
the host CPU and the build configuration.

The CI build log does not offer any clues about what implementation
was actually used when the tests failed. If the same thing happens
again, it will be helpful to (at least) know what CPU features the host
CPU supports. This will also be helpful when diagnosing any other CI
build failures which relate to CPU-specific code (or those which
related to external packages such as ICU).

It would be better to print even more information about the build
configuration. It would also be better to print host CPU information
on Windows CI builds as well.
2023-08-24 13:01:53 +02:00
Jorg Adam Sowa
6ee2a63476 Tests improvement for round() modes (#11996)
* Improved the tests for round() function

* Add EOL on the file ending
2023-08-24 11:34:37 +01:00
Niels Dossche
0fd226c277 Update DOM test to work around libxml2 bug
As reported in GH-12024, the test fails in the encoding part of the test
file. This is due to a libxml2 bug (that's been fixed in modern
versions, but of course various systems and distros are always behind).
The goal of this part of the test is to check if an encoding declaration
is outputted. So the actual encoding used doesn't matter.
Switch to UTF-8, which seems to always work, to work around the issue.
2023-08-23 21:52:53 +02:00
Máté Kocsis
462792ee51 Expose PDO_ODBC_TYPE to userland 2023-08-23 21:20:41 +02:00
Máté Kocsis
8726ae0601 Improve and fix ext/odbc tests
Some test failures are fixed, parallelization is enabled, section order is fixed.
2023-08-23 21:20:41 +02:00
Máté Kocsis
985511e968 Enable ext/odbc and ext/pdo_odbc tests on Linux in GitHub CI 2023-08-23 21:20:41 +02:00
Máté Kocsis
66acaba9db Add more test coverage for ext/odbc 2023-08-23 21:20:41 +02:00
Ilija Tovilo
c9e5e1fc52 Switch asan build to Ubuntu 23.04 in Docker
Closes GH-12034
2023-08-23 20:40:15 +02:00
Remi Collet
94e26dc895 [ci skip] bump zip version 2023-08-23 18:01:20 +02:00
George Peter Banyard
e055e12a2c [skip ci] Mark test as XLEAK due to LSAN bug (#12018)
This is due to apparently some combination of glibc and Clang 14 which we are unfortunately hitting
2023-08-23 13:19:13 +01:00
Ilija Tovilo
75f5b22085 Merge branch 'PHP-8.2'
* PHP-8.2:
  Move installation of oracle instant client in GHA
2023-08-23 11:31:26 +02:00
Ilija Tovilo
a8e5285437 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Move installation of oracle instant client in GHA
2023-08-23 11:28:59 +02:00
Ilija Tovilo
ba07a0b846 Move installation of oracle instant client in GHA
Closes GH-12033
2023-08-23 11:28:17 +02:00
Ilija Tovilo
bad5298707 Make php_cli_server_pdeathsig.phpt SKIPIF more specific 2023-08-22 23:51:56 +02:00
Cristian Rodríguez
782ffd761b Use a single version of strnlen (#12015)
* Zend: Make zend_strnlen available for use outside zend_compile

* exif: remove local php_strnlen, use zend_strnlen instead

* main: remove local strnlen, use zend_strnlen instead

* phar: remove local strnlen, use zend_strnlen
2023-08-22 17:40:24 +02:00
Peter Kokot
32cdd330f3 Remove unneeded zend_language_parser.h patch (#11974)
This was cleaned in 4cbffd89d9 and
patching the Zend/zend_language_parser.h file to include zend.h is not
needed anymore.
2023-08-22 11:21:42 +02:00
Peter Kokot
adc4a48d26 Fix configure phpdbg help output (#12013)
By default phpdbg is enabled (--enable-phpdbg) and user can get info in
the `./configure --help` output if they want to disable it like with the
other configuration options.
2023-08-22 02:52:06 +01:00
Peter Kokot
e199104a35 Fix passing null to parameter of type string (#12014)
This fixes builds without cgi or phpdbg:
  ./configure --disable-cgi --disable-phpdbg
  make
  ./sapi/cli/php run-tests.php

Otherwise, deprecation warnings (since PHP-8.1) are emitted:
  Deprecated: escapeshellarg(): Passing null to parameter #1 ($arg) of
  type string is deprecated in run-tests.php...
2023-08-22 02:51:31 +01:00
Peter Kokot
9026596fe9 Sync --enable-mysqlnd-compression-support option (#12006)
This syncs the style of the --enable-mysqlnd-compression-support option
name, otherwise in Autoconf both --enable-foo_bar and --enable-foo-bar
work.

Also the configure output message is synced to match the check
information.
2023-08-21 16:38:04 +02:00
Ayesh Karunaratne
1887f02b0b Add class constant types to Phar extension (#11826) 2023-08-21 07:14:45 +02:00
Peter Kokot
278a57f95a Add all README.* files to paths-ignore (#12003)
Within the entire repository these are documentation files and CI don't
need to run when they are changed.

This now includes also README.REDIST.BINS, README.md, and similar README
files within the sapi and ext directories.

README files in tests directories are also only for internals
documentations purposes.
2023-08-20 21:53:45 +02:00
Ayesh Karunaratne
e6627ccb52 gen_stub: fix regexps with unintentional range due to - character placement (#12004) 2023-08-20 14:20:56 +02:00
Niels Dossche
807a05ee55 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix memory leak when setting an invalid DOMDocument encoding
2023-08-20 14:07:44 +02:00
Niels Dossche
767697c4ae Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix memory leak when setting an invalid DOMDocument encoding
2023-08-20 14:07:25 +02:00
Niels Dossche
20ac42e1b0 Fix memory leak when setting an invalid DOMDocument encoding
Because the failure path did not release the string, there was a memory
leak.
As the only valid types for this function are IS_NULL and IS_STRING, we
and IS_NULL is always rejected in practice, solve the issue by not using
a function that increments the refcount in the first place.

Closes GH-12002.
2023-08-20 14:05:26 +02:00