1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00
Commit Graph

13978 Commits

Author SHA1 Message Date
Máté Kocsis 340b94e9ad Merge branch 'PHP-8.2'
* PHP-8.2:
  Declare ext/standard constants in stubs - part 7 (#9505)
2022-09-08 13:59:46 +02:00
Máté Kocsis 3227d04fa9 Declare ext/standard constants in stubs - part 7 (#9505) 2022-09-08 13:57:07 +02:00
Máté Kocsis ce9077d8e0 Merge branch 'PHP-8.2'
* PHP-8.2:
  Add support for validation of missing class synopses (#9472)
2022-09-05 14:21:49 +02:00
Máté Kocsis c547fc183c Add support for validation of missing class synopses (#9472) 2022-09-05 14:21:15 +02:00
Tim Düsterhus 181ac4617b Remove obsolete checks for random-related functionality from ext/standard/config.m4 (#9482)
The users of these checks have been moved to ext/random. ext/standard does not
reference the resulting defines.
2022-09-04 15:00:43 +02:00
David Bohman f098193d15 GH-9464: Fix build on older macOs releases.
A simple check for CommonCrypto/CommonRandom.h does not work on earlier macOS.
Must also pull in sys/types.h for size_t, Availability.h for __OSX_AVAILABLE_STARTING,
and CommonCrypto/CommonCryptoError.h for CCCryptorStatus.

Closes GH-9479.
2022-09-04 02:12:28 +01:00
Máté Kocsis e733ebf30e Add parenthesis around preprocessor conditions in stubs
gen_stub.php concatenates nested #ifs into one #if so let's make sure the semantics remain the same.
2022-09-02 16:21:28 +02:00
Máté Kocsis cfa72ff3af Declare ext/standard constants in stubs - part 6
Closes GH-9467
2022-09-02 16:07:25 +02:00
Máté Kocsis 5c3559464b Fix memory leak triggered by unsuccessful dynamic property unserialization
Closes GH-9468
2022-09-02 15:07:19 +02:00
Máté Kocsis 6f2f228e4a Declare ext/standard constants in stubs - part 5
Closes GH-9466
2022-09-02 15:04:49 +02:00
Máté Kocsis 64b962b241 Declare ext/standard constants in stubs - part 4
Closes GH-9465
2022-09-02 12:41:51 +02:00
Tim Düsterhus c77bbf6fe5 Mark crypt()'s $string parameter as #[\SensitiveParameter] 2022-08-30 20:02:28 +02:00
Tyson Andre 8b9679e88e Make var_export/debug_zval_dump check for infinite recursion on the *object* (#9448)
Switch the recursion check from the result of `get_properties_for`
(the returned hash table of properties) to just checking for
infinite recursion on the object.

- In order for a native datastructure to correctly implement
  `*get_properties_for` for var_export's cycle detection,
  it would need to return the exact same array every time prior to this PR.

  Prior to this commit, the requirements for cycle detection
  would prevent SplFixedArray or similar classes from returning a
  temporary array that:

  1. Wouldn't be affected by unexpected mutations from error handlers
  2. Could be garbage collected instead.
2022-08-30 09:19:45 -04:00
Máté Kocsis adb45a63c0 Fix GH-9186 @strict-properties can be bypassed using unserialization (#9354)
* Emit deprecation warnings when adding dynamic properties to classes during unserialization - this will become an Error in php 9.0.
  (Adding dynamic properties in other contexts was already a deprecation warning - the use case of unserialization was overlooked)
* Throw an error when attempting to add a dynamic property to a `readonly` class when unserializing
* Add new serialization methods `__serialize`/`__unserialize` for SplFixedArray to avoid creating deprecated dynamic
  properties that would then be added to the backing fixed-size array
* Don't add named dynamic/declared properties (e.g. $obj->foo) of SplFixedArray to the backing array when unserializing
* Update tests to declare properties or to expect the deprecation warning
* Add news entry

Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
2022-08-30 07:46:32 -04:00
Máté Kocsis b4ec3e9bc0 Do not generate CONST_CS when registering constants (#9439) 2022-08-28 08:27:19 +02:00
Máté Kocsis ef72d53397 Declare ext/standard constants in stubs - part 3 (#9427) 2022-08-26 14:47:34 +02:00
Máté Kocsis c573b8228a Declare ext/standard constants in stubs - part 2 (#9426) 2022-08-26 14:40:48 +02:00
Máté Kocsis bc4c012611 Declare ext/standard constants in stubs - part 1 (#9404) 2022-08-24 16:09:48 +02:00
Christoph M. Becker a1f5c8a587 Fix GH-9227: Trailing dots and spaces in filenames are ignored
Given that Windows ignores trailing dots and spaces in filenames, we
catch that ourselves to avoid confusion with the respective filenames
without these characters.

Closes GH-9229.
2022-08-19 14:23:57 +02:00
Christoph M. Becker 45a3f4cab0 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9316: $http_response_header is wrong for long status line
2022-08-18 12:31:56 +02:00
Christoph M. Becker 5d196d9e7c Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9316: $http_response_header is wrong for long status line
2022-08-18 12:30:45 +02:00
Christoph M. Becker 72da418719 Fix GH-9316: $http_response_header is wrong for long status line
While the reason-phrase in a HTTP response status line is usually
short, there is no actual limit specified by the RFCs.  As such, we
must not assume that the line fits into the buffer (which is currently
128 bytes large).

Since there is no real need to present the complete status line, we
simply read and discard the rest of a long line.

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>

Closes GH-9319.
2022-08-18 12:27:54 +02:00
David Carlier db64c1cb70 zend introduce const GNUC attribute. sub optimisation where there is no pointers, nor particular memory layout, thread local/volatile ... involved. usage concealed for now into little pack helpers.
Closes #9326.
2022-08-15 19:49:24 +01:00
twosee ef39adb638 Merge branch 'PHP-8.1'
* PHP-8.1:
  Re-fix GH-8409: SSL handshake timeout persistent connections hanging
  Revert "Fix GH-8409: SSL handshake timeout persistent connections hanging"
2022-08-14 20:15:35 +08:00
twosee 14d71957ca Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Re-fix GH-8409: SSL handshake timeout persistent connections hanging
2022-08-14 20:14:57 +08:00
twosee b8d07451d4 Re-fix GH-8409: SSL handshake timeout persistent connections hanging
This fix is another solution to replace d0527427be, use zend_try and zend_catch to make sure persistent stream will be released when error occurred.

Closes GH-9332.
2022-08-14 20:13:36 +08:00
Jakub Zelenka 897ca85d33 Revert "Fix GH-8409: SSL handshake timeout persistent connections hanging"
This reverts commit d0527427be.

This patch makes Swoole/Swow can not work anymore, because Coroutine will yield to another one during socket operation, EG(record_errors) assertion will always fail, and zend_begin_record_errors() was only used during compile time before.
Note: zend_emit_recorded_errors() and the typo fix are reserved.
2022-08-14 19:41:06 +08:00
Jakub Zelenka 438f692e92 Merge branch 'PHP-8.1' 2022-08-12 17:12:28 +01:00
Jakub Zelenka d0527427be Fix GH-8409: SSL handshake timeout persistent connections hanging
This is not actually related to SSL handshake but stream socket creation
which does not clean errors if the error handler is set. This fix
prevents emitting errors until the stream is freed.
2022-08-12 17:09:24 +01:00
Ilija Tovilo 98bdb7f99b Make pestr[n]dup infallible (#9295)
Fixes GH-9128
Closes GH-9295
2022-08-12 12:21:14 +02:00
Christoph M. Becker 1094a859ad Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-9296: `ksort` behaves incorrectly on arrays with mixed keys
2022-08-12 11:38:21 +02:00
Christoph M. Becker 7908aae30c Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-9296: `ksort` behaves incorrectly on arrays with mixed keys
2022-08-12 11:36:24 +02:00
Denis Vaksman cd1aed8edd Fix GH-9296: ksort behaves incorrectly on arrays with mixed keys
The comparator function used at ksort in SORT_REGULAR mode
need to be consistent with basic comparison rules. These rules
were changed in PHP-8.0 for numeric strings, but comparator
used at ksort kept the old behaviour. It leads to inconsistent
situations, when after ksort the first key is GREATER than some
of the next ones by according to the basic comparison operators.

Closes GH-9293.
2022-08-12 11:32:23 +02:00
Derick Rethans a6a5d46704 Simplify and move check for too high expiry time, which you can't reach on 32bit systems 2022-08-11 16:27:25 +01:00
Derick Rethans 15e3fcb468 Fixed GH-9200: setcookie has an obsolete expires date format 2022-08-11 16:27:25 +01:00
dixyes 279a297172 Windows arm64 build system support
Closes GH-9116.
2022-08-09 16:22:14 +02:00
dixyes 3a843f953b Windows arm64 zend and standard extension support
* Port zend_cpuid for windows arm64
* Fix zend_atomic windows arm64 build
* Fix windows arm64 multiply
* Enable arm64 neon for windows in standard extension
* Enable arm64 neon for windows in zend_hash.c
* Workaround for msvc arm64 optimization bug

Closes GH-9115.
2022-08-09 12:45:14 +02:00
Jakub Zelenka 80197c59ec Merge branch 'PHP-8.1' 2022-08-07 14:22:33 +01:00
Jakub Zelenka c9fa98a174 Merge branch 'PHP-8.0' into PHP-8.1 2022-08-07 14:21:39 +01:00
Jakub Zelenka d9ff5e079f Fix GH-8472: stream_socket_accept result may have incorrect metadata 2022-08-07 14:17:38 +01:00
Christoph M. Becker ad04345eb3 Fix GH-9244: Segfault with array_multisort + array_shift
After restructuring non-packed arrays, we either need to pack them if
possible, or to rehash them.

Closes GH-9247.
2022-08-05 17:09:54 +02:00
Christoph M. Becker 55f8c14224 Avoid unnecessary comparison
The first element of the `arrays` serves as base for the comparison, so
there is no need to compare it to itself.

Closes GH-9246.
2022-08-04 14:19:51 +02:00
Jakub Zelenka dc01fce36d Fix GH-8396: Network online test using https broken 2022-08-02 18:50:42 +01:00
Jakub Zelenka e5ab9f45d5 Fix bug #65489: glob() basedir check is inconsistent
This removes the inconsistent and incorrectly working open basedir check
on pattern in glob. It means that an empty array will be returned even
if the whole pattern is outside the open basedir restriction.
2022-08-02 18:36:29 +01:00
Nikita Popov 04f5da4b77 Avoid K&R style function declarations in sha1()
These are deprecated in C20.
2022-07-28 22:29:42 +02:00
Nikita Popov 6ff662b2e6 Fix unused-but-set-variable warning in hebrev() 2022-07-28 22:29:42 +02:00
Jakub Zelenka 1a9e6895f1 Fix #65069: GlobIterator incorrect handling of open_basedir check
This PR changes the glob stream wrapper so it impacts "glob://"
streamsas well. The idea is to do a check for each found path instead
of the pattern which was not working correctly.
2022-07-28 11:42:42 +01:00
Tim Düsterhus 5c693c770a Remove ->last_unsafe from php_random_status (#9132)
Whenever ->last_unsafe is set to `true` an exception has been thrown. Thus we
can replace the check for `->last_unsafe` with a check for `EG(exception)`
which is a much more natural way to ommunicate an error up the chain.
2022-07-26 09:02:51 +02:00
Michael Voříšek 60189aa96a Skip locale tests /w musl libc (#9141) 2022-07-25 23:56:14 +01:00
Michael Voříšek b0c0a2cfb4 Use -1 "precision" in gen_stub.php
Closes GH-8734.
2022-07-23 12:09:37 +02:00