1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 15:08:16 +02:00
Commit Graph

133090 Commits

Author SHA1 Message Date
Máté Kocsis 2f9f2928ce Improve test for odbc_columns()
Hopefully, intermittent test failures will be fixed by creating and using a separate database.

Furthermore, more meaningful test cases are added which also assert the output, as well as wildcard character based searching.
2023-08-29 00:26:25 +02:00
Máté Kocsis 9dcdfa5e3f Use correct format specifier 2023-08-29 00:26:24 +02:00
Jakub Zelenka 4e7ab1478d Small tyding up of filestat code 2023-08-28 22:22:54 +01:00
Jakub Zelenka 31833e6c4c Expand file path in file stat only for wrapper path (#12068) 2023-08-28 22:14:32 +01:00
Niels Dossche 1754794fc3 [ci skip] Fix typos in UPGRADING 2023-08-28 23:00:05 +02:00
Niels Dossche a3a3964497 Fix oss-fuzz #61712: assertion failure with error handler during binary op
Because the error handler is invoked after the property is updated,
the error handler has the opportunity to remove it before the property
is returned.

Switching the order around fixes this issue. The comments mention that
the current ordering prevents overwriting the EG(std_property_info)
field in the error handler. EG(std_property_info) no longer exists as it
was removed in 7471c217. Back then a global was used to store the
returned property info, but as this is no longer the case there is no
longer a need to protect against overwriting a global.

Closes GH-12062.
2023-08-28 20:00:49 +02:00
Peter Kokot 1413787884 Merge branch 'PHP-8.2'
* PHP-8.2:
  On riscv64 require libatomic if actually needed
2023-08-28 19:48:49 +02:00
Peter Kokot a1043fe051 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  On riscv64 require libatomic if actually needed
2023-08-28 19:47:44 +02:00
Jeremie Courreges-Anglas bf3fb4e5c9 On riscv64 require libatomic if actually needed
clang and newer gcc releases support byte-sized atomic accesses on
riscv64 through inline builtins.  In both cases the hard dependency on
libatomic added by GH-11321 isn't useful.

Stop using AC_CHECK_LIB() which is too naive to notice that libatomic
isn't needed.  Instead, PHP_CHECK_FUNC() will retry the check with -latomic
if required.

Closes GH-11790
2023-08-28 19:47:19 +02:00
Jakub Zelenka 766cac072f Fix bug #76857: Can read "non-existant" files
This change makes checked and opened file consistent in a way that it is
using real path for stat operation in the same way like it is used for
open.

Closes GH-12067
2023-08-28 16:53:28 +01:00
Ilija Tovilo 4e963bc99f Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Fix trailing data in unserialize in soap test
2023-08-28 17:25:15 +02:00
Ilija Tovilo c128dbdd69 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Fix trailing data in unserialize in soap test
2023-08-28 17:25:07 +02:00
Ilija Tovilo c8f6ee8c6f [skip ci] Fix trailing data in unserialize in soap test 2023-08-28 17:24:45 +02:00
Remi Collet 13d3564a51 Fix #12063 convert PHP single-quote to C double-quote string 2023-08-28 14:48:49 +02:00
Jakub Zelenka ba9650d697 Fix bug #52335 (fseek() on memory stream behavior different then file)
This changes memory stream to allow seeking past end which makes it the
same as seeking on files. It means the position is allowed to be higher
than the string length. The size only increases if data is appended to
the past position. The space between the previous string and position
is filled with zero bytes.

Fixes GH-9441
Closes GH-12058
2023-08-28 13:32:34 +01:00
Ilija Tovilo ea10e79bae Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix missing instantclient in CI
2023-08-28 14:25:45 +02:00
Ilija Tovilo ca4d7bf5f3 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix missing instantclient in CI
2023-08-28 14:23:47 +02:00
Ilija Tovilo f3bd027b69 Fix missing instantclient in CI
We should only pass the --with-pdo-oci and --with-oci8 flags if instantclient is
installed.

Closes GH-12066
2023-08-28 14:23:36 +02:00
Jakub Zelenka 5ea14a20a9 Merge branch 'PHP-8.2' 2023-08-28 12:18:21 +01:00
Jakub Zelenka 038bbd2d2f Merge branch 'PHP-8.1' into PHP-8.2 2023-08-28 12:15:33 +01:00
Jakub Zelenka e1396a314d Fix flaky file stat tests due to changing nature of atime 2023-08-28 12:14:55 +01:00
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