1
0
mirror of https://github.com/php/php-src.git synced 2026-04-16 12:31:06 +02:00
Commit Graph

58360 Commits

Author SHA1 Message Date
Dmitry Stogov
d02197853e Fixed assertion (ext/opcache/zend_persist.c:327: zend_accel_get_type_map_ptr: Assertion `ret > 2' failed) 2021-03-10 17:39:26 +03:00
Dmitry Stogov
d336ccaa08 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available for static Thread Local Storage)
2021-03-10 16:04:33 +03:00
Dmitry Stogov
3b377b51a2 Fixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available for static Thread Local Storage) 2021-03-10 16:03:47 +03:00
Dmitry Stogov
1d5f359f56 Use spl_filesystem_object.file_name for SPL_FS_DIR as a cache and prevent multiple file name reconstruction. 2021-03-09 17:37:24 +03:00
Christoph M. Becker
9f826e8ce9 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #51903: simplexml_load_file() doesn't use HTTP headers
2021-03-08 15:16:55 +01:00
Christoph M. Becker
7931956805 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #51903: simplexml_load_file() doesn't use HTTP headers
2021-03-08 15:15:59 +01:00
Christoph M. Becker
f901bec494 Fix #51903: simplexml_load_file() doesn't use HTTP headers
The `encoding` attribute of the XML declaration is optional; it is good
practice to use external encoding information where available if it is
missing.  Thus, we check for `charset` info of `Content-Type` headers,
and see whether the encoding is supported.

We cater to trailing parameters and quoted-strings, but not to escaped
backslashes and quotes in quoted-strings, since no known character
encoding contains these anyway.

Co-authored-by: Michael Wallner <mike@php.net>

Closes GH-6747.
2021-03-08 15:07:01 +01:00
Christoph M. Becker
8d58504035 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101
2021-03-08 14:52:45 +01:00
Christoph M. Becker
3880b8785b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101
2021-03-08 14:51:45 +01:00
manuel
5787f91c55 Fix #80838: HTTP wrapper waits for HTTP 1 response after HTTP 101
Don't wait for further responses after a HTTP 101 (Switching Protocols) response

Closes GH-6730.
2021-03-08 14:36:31 +01:00
Nikita Popov
8a134c9a26 Merge branch 'PHP-8.0'
* PHP-8.0:
  Add supports for FreeBSD's PROT_MAX to let mprotect knows X flag can be applied in addition.
2021-03-05 16:44:25 +01:00
David Carlier
ae23852e41 Add supports for FreeBSD's PROT_MAX to let mprotect knows X flag can be applied in addition.
Closes GH-6738.
2021-03-05 16:44:08 +01:00
Nikita Popov
08ad9af2ca Reduce date test threshold further
Still seeing the occasional spurious failure.
2021-03-05 16:31:24 +01:00
Christoph M. Becker
9f7c6a824a Merge branch 'PHP-8.0'
* PHP-8.0:
  Print error code if CreateMutex() fails
2021-03-05 15:09:26 +01:00
Christoph M. Becker
1c16749eaa Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Print error code if CreateMutex() fails
2021-03-05 15:08:24 +01:00
Christoph M. Becker
e0e167e581 Print error code if CreateMutex() fails
This issue came up recently in a bug report[1]; without the error code,
users can barely guess why the function failed.

[1] <https://bugs.php.net/80812>

Closes GH-6745.
2021-03-05 15:06:18 +01:00
Nikita Popov
670b19af3e Reduce threshold in ext/date/tests/bug73837.phpt
Now that this code is faster, we're seeing many spurious failures.
2021-03-04 17:02:02 +01:00
Max Semenik
c639d34a6e Update mysqli tests to work with newer MySQL server
* @@session.old_passwords is present only in 5.6 and 5.7. Newer versions
  already behave as if they have old_passwords=2.
* SET PASSWORD FOR ... = PASSWORD(...) syntax was removed in 8.0.

For all affected tests, versions that don't support newer SQL are
already explicitly excluded with version checks.

Closes GH-6729.
2021-03-04 16:34:11 +01:00
Nikita Popov
4d43cbe333 Add mechanism to skip the skipif cache
If the SKIPIF section return nocache, don't cache the result. This
is used by tests that perform complex test set in conjunction with
skip checks, and need to be evaluated every time.
2021-03-04 16:28:11 +01:00
Nikita Popov
97de8cfc71 Fix dynamic func def persist with preloading
If we find an existing serialization of the op_array, of course
we also need to actually make use of it...
2021-03-04 16:15:05 +01:00
Dmitry Stogov
6543d4bc1d Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix ASAN warning (Zend/zend_string.h:165:2: runtime error: null pointer passed as argument 2 of memcpy(), which is declared to never be null)
2021-03-04 17:28:25 +03:00
Dmitry Stogov
187ba4353a Fix ASAN warning (Zend/zend_string.h:165:2: runtime error: null pointer passed as argument 2 of memcpy(), which is declared to never be null) 2021-03-04 17:27:26 +03:00
Dmitry Stogov
16649cb60d Cache haschildren/getchildren methods of recursive iterators. 2021-03-04 17:04:55 +03:00
twosee
db33af7104 Remove duplicated SSL_CTX_set_verify()
Duplicated with line 920.
Our minimal OpenSSL version is v1.0.1 (See https://github.com/openssl/openssl/blob/OpenSSL_1_0_1-stable/ssl/ssl_lib.c#L2039).
Removing it does not affect program behavior.
Closes GH-6751.
2021-03-04 17:51:29 +08:00
Dmitry Stogov
b4e9b18463 Avoid useless date conversion 2021-03-04 12:27:31 +03:00
Nikita Popov
500b4b4945 Explicitly print reference wrappers in debug_zval_dump()
Closes GH-6750.
2021-03-04 10:11:37 +01:00
Dmitry Stogov
4b59071844 Switch to new ZPP 2021-03-04 02:11:21 +03:00
Dmitry Stogov
dd3bfb3704 Switch to new ZPP 2021-03-04 02:10:53 +03:00
Dmitry Stogov
d02734f05e Loop invariant code motion 2021-03-04 02:10:10 +03:00
Christoph M. Becker
1c56a830ce Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80825: ZipArchive::isCompressionMethodSupported does not exist
2021-03-03 22:57:51 +01:00
Christoph M. Becker
4f478af16d Fix #80825: ZipArchive::isCompressionMethodSupported does not exist
`HAVE_METHOD_SUPPORTED` should have been defined after we updated to
libzip 1.7.1 months ago.
2021-03-03 22:56:42 +01:00
Alex McLean
ec5e811dbd Add test cases for bcmath ValueErrors
Closes GH-6714

Signed-off-by: George Peter Banyard <girgias@php.net>
2021-03-03 18:35:15 +00:00
Christoph M. Becker
2dc2436e08 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix test wrt. server.inc changes
2021-03-03 12:05:03 +01:00
Christoph M. Becker
303a4ae44a Fix test wrt. server.inc changes 2021-03-03 12:04:06 +01:00
Christoph M. Becker
8162abeb17 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #78719: http wrapper silently ignores long Location headers
2021-03-03 10:48:43 +01:00
Christoph M. Becker
90b24401d6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78719: http wrapper silently ignores long Location headers
2021-03-03 10:47:51 +01:00
Christoph M. Becker
51e2015af3 Fix #78719: http wrapper silently ignores long Location headers
When opening HTTP streams, and reading the headers, we currently
discard header lines longer than `HTTP_HEADER_BLOCK_SIZE` (1024 bytes).
While this is not generally forbidden by RFC 7230, section 3.2.5, it
is not generally allowed either, since that may change the "message
framing or response semantics".

We thus fix this by allowing arbitrarily long header lines.

Closes GH-6720.
2021-03-03 10:45:25 +01:00
Nikita Popov
3a867b9827 Fixed bug #80808
If the ZEROFILL flag is set for a field, do not convert it into
an integer (text protocol) or convert it explicitly into a padded
string (binary protocol).
2021-03-02 10:59:34 +01:00
Dmitry Stogov
c28751c69c Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)
2021-03-02 00:01:01 +03:00
Dmitry Stogov
957cb13a49 Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT) 2021-03-01 23:57:20 +03:00
Dmitry Stogov
f9f8c1c79c Optimized object encoding without rebulding properties HashTable 2021-03-01 22:37:05 +03:00
Christoph M. Becker
87a5a0e2cb Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80751: Comma in recipient name breaks email delivery
2021-03-01 18:50:58 +01:00
Christoph M. Becker
37c9728615 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80751: Comma in recipient name breaks email delivery
2021-03-01 18:50:11 +01:00
Christoph M. Becker
71297a254b Fix #80751: Comma in recipient name breaks email delivery
So far, `SendText()` simply separates potential email address lists at
any comma, disregarding that commas inside a quoted-string do not
delimit addresses.  We fix that by introducing an own variant of
`strtok_r()` which caters to quoted-strings.

We also make `FormatEmailAddress()` aware of quoted strings.

We do not cater to email address comments, and potentially other quirks
of RFC 5322 email addresses, but catering to quoted-strings is supposed
to solve almost all practical use cases.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-6735.
2021-03-01 18:46:21 +01:00
Máté Kocsis
1cb823c82e Declare XMLReader properties
Closes GH-6741
2021-03-01 16:58:23 +01:00
Tyson Andre
b4fbf1d381 Optimize serializing class names
Because of the memcpy, compilers can't infer that ZSTR_LEN (i.e. class_name->len)
did not change, so they copy it out of memory into a register for the last two
accesses.
php_var_serialize_string already does something similar.

Closes GH-6734
2021-03-01 09:41:13 -05:00
Nikita Popov
e857936518 Fixed bug #80805
Handle missing result_var in binary_op_result_type.

(cherry picked from commit 8446e28275)
2021-03-01 15:13:15 +01:00
Dmitry Stogov
fa14eedbea Optimized object serialization without rebulding properties HashTable 2021-03-01 16:10:56 +03:00
Dmitry Stogov
56afe2f230 Incomplete class may have only single "MAGIC_MEMBER" 2021-03-01 14:53:30 +03:00
Dmitry Stogov
b0c7ea4919 Change the order of properties used in foreach(), var_dump(), serialize(), comparison, etc. Now properties are ordered according to their layout in zend_object structure. 2021-03-01 13:43:22 +03:00