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

59735 Commits

Author SHA1 Message Date
Christoph M. Becker
86bc48c9e7 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81327: Error build openssl extension on php 7.4.22
2021-08-04 18:45:56 +02:00
Christoph M. Becker
5628afb782 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81327: Error build openssl extension on php 7.4.22
2021-08-04 18:44:06 +02:00
Christoph M. Becker
6724d5d4c2 Fix #81327: Error build openssl extension on php 7.4.22
The recent fix for bug 52093 is not compatible with LibreSSL ≥ 2.7.0,
which we recognize as mostly OpenSSL 1.1.0 compatible, but they still
do not support `ASN1_INTEGER_set_int64()`.

Closes GH-7339.
2021-08-04 18:41:04 +02:00
Nikita Popov
384ad6e224 Use EVP_PKEY APIs for openssl_private_encrypt/public_decrypt
Use high level APIs instead of deprecated low level APIs.
2021-08-04 16:58:41 +02:00
Nikita Popov
0233afae27 Use EVP_PKEY API for openssl_public_encrypt/private_decrypt
Use the high level API instead of the deprecated low level API.
2021-08-04 16:44:29 +02:00
Nikita Popov
503146aa87 Avoid RC4 use in another test 2021-08-04 12:57:15 +02:00
Nikita Popov
a80ae97d31 Only report provided ciphers in openssl_get_cipher_methods()
With OpenSSL 3 ciphers may be registered, but not provided. Make
sure that openssl_get_cipher_methods() only returns provided
ciphers, so that "in_array openssl_get_cipher_methods" style
checks continue working as expected.
2021-08-04 12:56:32 +02:00
Nikita Popov
9695936341 Don't test legacy algorithms in SPKI tests
MD4 and RMD160 may not be available on newer OpenSSL versions.
2021-08-04 12:02:58 +02:00
Nikita Popov
046b36bcf8 Use different cipher in openssl_seal() test
RC4 is insecure and not supported in newer versions.
2021-08-04 12:02:57 +02:00
Nikita Popov
0a530d7650 Adjust some tests for whitespace differences in OpenSSL 3
A trailing newline is no longer present in OpenSSL 3.
2021-08-04 10:01:19 +02:00
Nikita Popov
3ea57cf838 Reduce security level in some OpenSSL tests
This allows tests using older protocols and algorithms to work
under OpenSSL 3.

Also account for minor changes in error reporting.
2021-08-04 10:00:40 +02:00
Nikita Popov
6249172ae3 Optimize openssl memory leak test
Just do one call and check whether memory usage changes. Looping
this 100000 times is extremely slow with debug builds of openssl.
2021-08-04 10:00:28 +02:00
Christoph M. Becker
c2b017a96d Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #51498: imagefilledellipse does not work for large circles
2021-08-03 16:22:22 +02:00
Christoph M. Becker
213ad544e4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #51498: imagefilledellipse does not work for large circles
2021-08-03 16:20:16 +02:00
Christoph M. Becker
c565555f03 Fix #51498: imagefilledellipse does not work for large circles
We backport the respective upstream fix[1].

[1] <ace7fd88dc>

Closes GH-7329.
2021-08-03 16:17:47 +02:00
Remi Collet
1aaec4df67 SKIPIF to EXTENSIONS 2021-08-03 12:16:13 +02:00
Remi Collet
649af56ad6 Merge branch 'PHP-8.0'
* PHP-8.0:
  typo
2021-08-03 12:10:30 +02:00
Remi Collet
940c35366d typo 2021-08-03 12:10:20 +02:00
Remi Collet
a48bf8a0b9 Merge branch 'PHP-8.0'
* PHP-8.0:
  NEWS
  Fix bug #81325  Segfault in zif_simplexml_import_dom
2021-08-03 12:08:03 +02:00
Remi Collet
112527d677 Fix bug #81325 Segfault in zif_simplexml_import_dom 2021-08-03 12:06:36 +02:00
Javier Eguiluz
70872dde94 Remove a redundant expression 2021-08-02 21:51:26 +02:00
Joe Watkins
05ef6334cd Fix bug #81303 improve match errors 2021-08-02 17:31:26 +02:00
Nikita Popov
604848188b Add additional double to string APIs
zend_double_to_str() converts a double to string in the way that
(string) would (using %.*H using precision).

smart_str_append_double() provides some more fine control over
the precision, and whether a zero fraction should be appeneded
for whole numbers.

A caveat here is that raw calls to zend_gcvt and going through
s*printf has slightly different behavior for the degenarate
precision=0 case. zend_gcvt will add a dummy E+0 in that case,
while s*printf convert this to precision=1 and will not. I'm
going with the s*printf behavior here, which is more common,
but does result in a minor change to the precision.phpt test.
2021-08-02 16:14:53 +02:00
Nikita Popov
e14fbc84ac Remove FORMAT_CONV_MAX_PRECISION
This used to be necessary in the past because the NUM_BUF_SIZE
was set to 512, which is shorter than DOUBLE_MAX_LENGTH. Now the
value is either DOUBLE_MAX_LENGTH or larger (2048).
2021-08-02 15:59:26 +02:00
Nikita Popov
d28f6e694d Move php_gcvt to zend_gcvt
Also move PHP_DOUBLE_MAX_LENGTH to ZEND_DOUBLE_MAX_LENGTH.
2021-08-02 14:51:46 +02:00
Javier Eguiluz
7c9ac479eb Fix some mismatches in preprocessor directive comments 2021-08-02 11:18:36 +02:00
Frago9876543210
9fb93e8ed1 Fixed failed test in extension skeleton 2021-08-02 11:12:42 +02:00
Nikita Popov
9fe3aab7c5 Remove declares inside functions as well 2021-08-02 10:41:27 +02:00
Nikita Popov
8356da600b Remove dynamic defs from methods as well
We need to remove DECLARE_FUNCTION + dynamic_defs for functions
defined in methods as well, not just for those declared in the
main script.
2021-08-02 10:29:58 +02:00
Christopher Jones
328a07daf5 Update OCI8 tests for oci8.old_oci_close_semantics deprecation 2021-08-02 11:35:27 +10:00
Kamil Tekiela
cd0cd3d31e Fix typos (#7327) 2021-08-01 18:03:30 +01:00
Nikita Popov
1a370d3321 Skip some tests under --preload
A genuine problem here is that we sometime get different class
casing due interaction with the ZSTR CE cache. Ignore these for
now.
2021-07-30 17:26:39 +02:00
Nikita Popov
06cf4ff03e Tweak some tests to be --preload compatible
Avoid unnecessary output before a deprecation warning.
2021-07-30 17:26:32 +02:00
Nikita Popov
185212109c Fix session + Serializable tests
These were broken when the deprecation warning was added, as the
extra output prevented the session from being started.
2021-07-30 16:13:05 +02:00
Nikita Popov
9ee9393784 Skip shebang on preload script 2021-07-30 16:11:47 +02:00
Nikita Popov
67b5d8fcdc Don't reverse class order during preloading
We don't guarantee any particular order, but this reduces test
failures under --preload that are sensitive to class order.

Add some ZEND_HASH_FOREACH_*_FROM macros to allow skipping the
persistent classes while iterating in forward direction.
2021-07-30 15:14:17 +02:00
Nikita Popov
d836046ab8 Perform preloading attempt on copied class
It is very hard to determine in advance whether class linking will
fail due to missing dependencies in variance checks (#7314 attempts
this). This patch takes an alternative approach where we try to
perform inheritance on a copy of the class (zend_lazy_class_load)
and then restore the original class if inheritance fails. The fatal
error in that case is recorded and thrown as a warning later.

Closes GH-7319.
2021-07-30 15:09:49 +02:00
Kamil Tekiela
6b1337b736 Fix typo [no-ci] 2021-07-30 13:58:28 +01:00
Andrii Dembitskyi
d7b77a40e6 Fix SplFileObject::fseek() method description (#7321) 2021-07-30 13:50:43 +01:00
Nikita Popov
b1b0c81e39 Don't print preload warning for non-top-level classes
Dynamically declared classes categorically do not get linked during
preloading, even if all their dependencies are known. The warning
is misleading in this case, and there isn't anything the user can
do to address it.
2021-07-30 10:27:51 +02:00
Kamil Tekiela
132d499424 Drop mysqlnd statistics triggers
This functionality is not used productively in PHP and it's not used in
any of the extensions to my knowledge. Since it looks like this functionality
isn't required by anyone, let's clean up mysqlnd and drop it.
2021-07-29 14:21:13 +01:00
Kamil Tekiela
fb85731c67 Remove get_parameter_metadata 2021-07-29 14:21:13 +01:00
Kamil Tekiela
254d1641bb Remove mysqlnd_field_type_name 2021-07-29 14:21:13 +01:00
Nikita Popov
9e66455fbc Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix parameter name in count() error message
2021-07-29 14:25:22 +02:00
Nikita Popov
6c7b322de2 Fix parameter name in count() error message
This parameter has been renamed to $value.
2021-07-29 14:25:13 +02:00
Nikita Popov
fc45223f85 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix parameter name in call_user_func() error message
2021-07-29 12:49:17 +02:00
Nikita Popov
840e441d2d Fix parameter name in call_user_func() error message
This parameter name has been changed to $callback.
2021-07-29 12:48:25 +02:00
Nikita Popov
29aed2a6c8 Clean up dependency resolution during preloading
Combine the code for checking whether all dependencies are
available and reporting an error if they are not. Actually store
the loaded deps and then use those when checking for type
availability, instead of looking up the same classes again and
again.
2021-07-28 16:55:06 +02:00
Mike Pall
58040f257c DynASM/x86: Add missing escape in pattern. 2021-07-28 17:13:08 +03:00
Nikita Popov
e011952576 Preload unlinked classes, remove preload autoload (#7311)
Currently, classes that can't be linked get moved back into the original script
and are not preloaded. As such classes may be referenced from functions that
did get preloaded, there is a preload autoload mechanism to load them at
runtime.

Since PHP 8.1, we can safely preload unlinked classes, which will then go
through usual lazy loading. This means that we no longer need the preload
autoload mechanism. However, we need to be careful not to modify any hash
table buckets in-place, and should create new buckets for lazy loaded classes.
2021-07-28 14:27:58 +02:00