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

58713 Commits

Author SHA1 Message Date
Stanislav Malyshev 3d2c810eeb Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80710: imap_mail_compose() header injection
2021-04-26 22:26:42 -07:00
Stanislav Malyshev a4d9ccbcd6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80710: imap_mail_compose() header injection
2021-04-26 21:49:38 -07:00
Stanislav Malyshev 568df31698 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80710: imap_mail_compose() header injection
2021-04-26 21:48:16 -07:00
Christoph M. Becker 37962c61d2 Fix #80710: imap_mail_compose() header injection
Like `mail()` and `mb_send_mail()`, `imap_mail_compose()` must prevent
header injection.  For maximum backward compatibility, we still allow
header folding for general headers, and still accept trailing line
breaks for address lists.
2021-04-26 21:43:03 -07:00
Stanislav Malyshev 476888d99b Merge branch 'PHP-8.0'
* PHP-8.0:
  Revert "Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement"
2021-04-26 21:03:23 -07:00
Stanislav Malyshev eed03fce59 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement"
2021-04-26 21:02:09 -07:00
Stanislav Malyshev 2b3346208a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Revert "Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement"
2021-04-26 21:02:03 -07:00
Stanislav Malyshev 1b88c85cd8 Revert "Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement"
Sorry, this solution seems to have BC breaks, will need to look
for better one.

This reverts commit 9f7e8b777c.
2021-04-26 21:01:25 -07:00
Stanislav Malyshev 833fac34d0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement
2021-04-26 20:51:46 -07:00
Stanislav Malyshev 6de2d54425 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement
2021-04-26 20:50:29 -07:00
Stanislav Malyshev 76637017ac Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement
2021-04-26 20:50:15 -07:00
Christoph M. Becker 9f7e8b777c Fix #80852: Stack-overflow when json_encode()'ing SimpleXMLElement
We ignore `XML_ENTITY_DECL` nodes when getting the hash of the
properties of a `SimpleXMLElement`.
2021-04-26 20:43:45 -07:00
Máté Kocsis 12799847a6 Merge branch 'PHP-8.0'
* Fix pg_get_notify() parameter name
2021-04-26 19:38:57 +02:00
Máté Kocsis d1e590fe72 Fix pg_get_notify() parameter name
Closes GH-6916
2021-04-26 19:37:41 +02:00
Aaron Piotrowski c276c16b66 Implement Fibers
RFC: https://wiki.php.net/rfc/fibers

Closes GH-6875.
2021-04-26 11:07:06 -05:00
Nikita Popov ba337577a8 Use zend_string for pgsql_trim_message 2021-04-26 16:45:38 +02:00
Christoph M. Becker 50f5877769 Fix new test wrt. removed skipif.inc 2021-04-26 16:29:43 +02:00
Nikita Popov f26047fc9b Don't store resolved pgsql field/table oids as resources
Store these in hash tables indexed by oid. This is simpler and
more efficient, as we don't need to create resources or hash keys.
2021-04-26 15:24:07 +02:00
Christoph M. Becker c0ae3a7fb7 Fix #80901: Info leak in ftp extension
We ensure that inbuf is NUL terminated on `ftp_readline()` failure.

Closes GH-6894.
2021-04-26 15:07:08 +02:00
Nikita Popov 8a283f7b87 Store pgsql le_string as zend_string 2021-04-26 15:01:44 +02:00
Christoph M. Becker 5d7219dce6 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80901: Info leak in ftp extension
2021-04-26 14:46:43 +02:00
Christoph M. Becker 33d49551d1 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80901: Info leak in ftp extension
2021-04-26 14:45:55 +02:00
Christoph M. Becker 09696eee9d Fix #80901: Info leak in ftp extension
We ensure that inbuf is NUL terminated on `ftp_readline()` failure.

Closes GH-6894.
2021-04-26 14:23:04 +02:00
Máté Kocsis b567a9d173 Use typed properties in ext/zip
Closes GH-6881
2021-04-26 13:21:17 +02:00
Calvin Buckley 28a66b3f02 Check liveness in PDO_ODBC
PDO drivers allow for it, and procedural ODBC has its own facility
for it, but PDO_ODBC doesn't. If a connection is severed (for example,
on IBM i, ending a databse job, or killing the network connection
elsewhere), a persistent connection could get stuck. This adapts the
procedural ODBC code to PDO for handling connection liveness, so PDO
can reconnect if needed.

A discussion about the method to check liveness is linked; this might
not be the best method, but it's what procedural ODBC uses, so it's
consistent.

Closes GH-6805.
2021-04-26 13:03:07 +02:00
Christoph M. Becker 93e6796fc0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Export gzfwrite()
2021-04-26 12:12:48 +02:00
Christoph M. Becker fe219d912e Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Export gzfwrite()
2021-04-26 12:12:04 +02:00
Christoph M. Becker a2771296c0 Export gzfwrite()
Extensions calling `gzfwrite()` cannot be built when linked against
php.dll (built with zlib support) otherwise.

Closes GH-6880.
2021-04-26 12:09:31 +02:00
matt 25dc931d83 Fixed bug #80908
The last insert ID should be an unsigned integer.

Closes GH-6810.
2021-04-26 11:50:12 +02:00
Máté Kocsis 0cd06d1d19 Merge branch 'PHP-8.0'
* Fix arginfo/ZPP mismatch for simplexml_import_dom
2021-04-26 11:12:12 +02:00
Máté Kocsis cb84e5c332 Fix arginfo/ZPP mismatch for simplexml_import_dom
Closes GH-6905
2021-04-26 11:09:30 +02:00
Kamil Tekiela 0a779040a0 Add test case for errorCode() 2021-04-25 15:57:43 +01:00
Kamil Tekiela 3292b9761a Add ZEND_ASSERT to stmt->errorCode 2021-04-25 15:57:43 +01:00
Anatol Belski 9b78000432 Revert "fileinfo: Obey POSIX in pattern conversion"
This reverts commit 343d1c2b1f.

Also remove the incompatible test data for time being. The new line
handling will need an extra fix.

Signed-off-by: Anatol Belski <ab@php.net>
2021-04-24 14:59:53 +02:00
Anatol Belski 343d1c2b1f fileinfo: Obey POSIX in pattern conversion
Signed-off-by: Anatol Belski <ab@php.net>
2021-04-24 01:40:15 +02:00
Anatol Belski 34bdab538b fileinfo: Pull upstream tests
Integrating the upstream tests is important to ensure the quality of the
patch and to ensure the parity in the function.

Signed-off-by: Anatol Belski <ab@php.net>
2021-04-23 22:01:34 +02:00
Nikita Popov dc7030300c Use interned strings for error_get_last()
We have known strings for all the array keys, use them.
2021-04-23 11:05:14 +02:00
Nikita Popov b66eb866c9 Convert last_error_file to zend_string 2021-04-23 11:05:14 +02:00
Nikita Popov a1c6ee2164 Convert error filename to zend_string
Error handling functions/callbacks now accept the error filename
as a zend_string* instead of a const char*.
2021-04-23 11:05:14 +02:00
Dmitry Stogov 8c420bd265 Remove useless masking 2021-04-22 23:49:02 +03:00
Máté Kocsis 30a082cb16 Make some exception properties typed
Closes GH-6891
2021-04-22 10:22:50 +02:00
Niklas Keller 59d5b3dd51 Accept null for microseconds argument in stream_select() (#6879)
The deprecation of passing null is thrown otherwise.

If the timeout is calculated conditionally before calling stream_select(), passing to avoid the deprecation seems unreasonable, example:

https://github.com/amphp/amp/blob/7d4bbc6e0b47c6bb39b6cce1a4b5942e0c5125fb/lib/Loop/NativeDriver.php#L286

Also enforce that if $seconds is null, then $microseconds should be null as well. However 0 is still accepted (with deprecation) for backwards compatibility.
2021-04-22 10:09:55 +02:00
Dmitry Stogov 76452651ba Fixed incorrect error message 2021-04-22 02:40:22 +03:00
Dmitry Stogov 3c37a3426b Fixed possible incorrect assumption if constant is a power of 2. 2021-04-22 02:32:49 +03:00
Máté Kocsis 533a6bcb29 Get rid of private final methods (#6892) 2021-04-21 10:08:25 +02:00
Christoph M. Becker 950bb84c7e Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix php_pgsql_fd_cast() wrt. php_stream_can_cast()
2021-04-20 18:32:05 +02:00
Christoph M. Becker 3c6480552d Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix php_pgsql_fd_cast() wrt. php_stream_can_cast()
2021-04-20 18:30:25 +02:00
Christoph M. Becker 1fcea24efb Fix php_pgsql_fd_cast() wrt. php_stream_can_cast()
`php_stream_can_cast()` forwards to `_php_stream_cast()` with `ret` set
to `NULL`.  `php_pgsql_fd_cast()` needs to cater to that, because
otherwise the stream would report that it is not castable.

This *might* fix https://bugs.php.net/73903.

Closes GH-6888.
2021-04-20 18:29:12 +02:00
Máté Kocsis f11411ea0d Use typed property in PDOException 2021-04-20 14:45:42 +02:00
Máté Kocsis a92f5cbe32 Use typed property in RegexIterator 2021-04-20 14:45:42 +02:00