Commit Graph

5325 Commits

Author SHA1 Message Date
Nikita Popov
ef56b2c977 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #79468
2020-04-14 12:01:51 +02:00
dinosaur
95eaccd0bb Fixed bug #79468
Close the stream filter resources when removing them from the stream.
2020-04-14 11:59:51 +02:00
Christoph M. Becker
33226c3a17 Next is 7.3.18 2020-03-31 10:22:55 +02:00
Christoph M. Becker
8657f03084 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78210: Invalid pointer address
2020-03-11 11:31:26 +01:00
Christoph M. Becker
53797c206a Fix #78210: Invalid pointer address
This is actually about three distinct issues:

* If an empty string is passed as $address to `stream_socket_sendto()`,
  the `sa` is not initialized, so we must not pass it as `addr` to
  `php_stream_xport_sendto()`.

* On POSIX, `recvfrom()` truncates messages which are too long to fit
  into the specified buffer (unless `MSG_PEEK` is given), discards the
  excessive bytes, and returns the buffer length.  On Windows, the same
  happens, but `recvfrom()` returns `SOCKET_ERROR` with the error code
  `WSAEMSGSIZE`.  We have to catch this for best POSIX compatibility.

* In `php_network_parse_network_address_with_port()`, we have to zero
  `in6` (not only its alias `sa`) to properly support IPv6.

Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
2020-03-11 11:30:15 +01:00
Christoph M. Becker
02beefd5af PHP-7.4 is now 7.4.5-dev 2020-03-06 17:49:55 +01:00
Christoph M. Becker
9dda3b9eb2 Next is 7.3.17 2020-03-03 10:19:31 +01:00
Christoph M. Becker
93b183ed55 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79254: getenv() w/o arguments not showing changes
2020-02-11 11:57:57 +01:00
Christoph M. Becker
7b464ce6f3 Fix #79254: getenv() w/o arguments not showing changes
To be able to see changes done only with `SetEnvironmentVariable()`, we
have to use `GetEnvironmentStrings()` instead of `environ`, because the
latter sees only changes done with `putenv()`.

For best backward compatibility we're using `GetEnvironmentStringsA()`;
switching to the wide string version likely makes sense for master,
though.
2020-02-11 11:47:29 +01:00
Christoph M. Becker
e3632fdc0d Next is 7.3.16 2020-02-04 11:38:29 +01:00
Nikita Popov
58b17906f5 Apply tidy formatting
Mostly reindent PHP scripts to spaces.
2020-02-03 13:41:31 +01:00
Nikita Popov
1cccbb8ff1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix bug #78323: Code 0 is returned on invalid options
2020-01-27 13:32:38 +01:00
Ivan Mikheykin
fd08f062ae Fix bug #78323: Code 0 is returned on invalid options
Set CLI exit code to 1 when invalid parameters are passed,
and print error to stderr.
2020-01-27 13:32:19 +01:00
Nikita Popov
6489e29831 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed bug #78902
  Add unit test for bug #78902
2020-01-23 14:58:10 +01:00
liudaixiao
67421a780d Fixed bug #78902 2020-01-23 14:57:16 +01:00
Nikita Popov
018251a7c4 Fixed bug #71876
This is a backport of fcdc0a6db0
to the PHP-7.3 branch. We need to make sure that OnUpdateString
is also called for a NULL value, otherwise the reset of the encoding
at the end of the request will not work.

I believe I already tried to land this before once, but it didn't
actually end up on the PHP-7.3 branch due to a push conflict that
I only noticed just now.
2020-01-17 09:47:31 +01:00
Christoph M. Becker
7ea4f0e47e Bump version 2020-01-08 18:26:14 +01:00
Christoph M. Becker
38c0a53b60 Bump version 2020-01-07 11:03:19 +01:00
Nikita Popov
003be875e4 Make url_stats in resolve_path quiet
These stats are used to check whether the file exists -- they
should not generate errors. Having the flag set is particularly
important for custom stream wrappers.
2019-12-30 23:22:26 +01:00
Nikita Popov
f77747b06c Properly propagate url_stat exceptions during include
Make sure we abort operations early, and that we don't emit
additional warnings or errors if an exception has been thrown.
2019-12-30 22:56:42 +01:00
Nikita Popov
10eb0b3110 Fixed bug #79000
Don't report EAGAIN/EWOULDBLOCK as errors for fwrite on
non-blocking socket streams. This matches behavior for fread,
as well as behavior for plain file streams.

Closes GH-5026.
2019-12-20 11:37:43 +01:00
Nikita Popov
e45b613950 Free buffer in php_verror even if it is empty
vspprintf allocates a buffer even if the resulting string is empty.
2019-12-17 16:46:52 +01:00
Nikita Popov
fcdc0a6db0 Fix resetting of internal_encoding and friends
We need to update the value even if new_value is NULL. In particular,
it should be reset back to NULL after each request if the setting was
not specified on startup. Otherwise we leave dangling pointers.
2019-12-17 16:27:56 +01:00
Kachalin Alexey
79376ab209 Fix #78929: plus signs in cookie values are converted to spaces
We switch the cookie value parsing function from `php_url_decode()` to
`php_raw_url_decode()`, so that cookie values are now parsed according
to RFC 6265, section 4.1.1.  We also refactor to remove duplicate code
without changing the execution flow.
2019-12-12 14:21:46 +01:00
Derick Rethans
2badeb511b PHP-7.4 is now 7.4.2-dev 2019-12-10 16:56:33 +00:00
Christoph M. Becker
65bbc67063 Next is 7.3.14 2019-12-03 12:04:17 +01:00
Christoph M. Becker
996f217aa5 Fix #78883: fgets(STDIN) fails on Windows
We add the `is_seekable` member to `php_stdio_stream_data`, and prefer
that over `is_pipe`, since the latter is simply a misnomer.  We keep
`is_pipe` for now for Windows only, though, because we need special
support for pipes there.  We also fix the misaligned bitfield which
formerly took 33 bit.
2019-12-02 16:52:32 +01:00
Christoph M. Becker
4c9ba3e042 7.3.13 is next 2019-11-05 18:20:56 +01:00
Nikita Popov
333d607d47 Fix bug #77930: Remove mmap limit
First, the limitation already doesn't trigger if you copy the whole
file (i.e. use copy() or stream_copy_to_stream() and don't specify
a length). This happens because length will be 0 at the time of the
check and only later calculated based on the file size. This means
that we're already completely blowing the length limit for what is
likely the most common case, and it doesn't seem like anyone complained
about that.

Second, the premise of the code comment ("to avoid runaway swapping")
seems incorrect to me. Because this performs a file-backed non-private
mmap, no swap backing is needed for the mapping. Concerns over "memory
usage" are also misplaced, as this is a virtual mapping.
2019-10-31 09:37:05 +01:00
Remi Collet
5a024d2c5b Fix #78662: stream_write bad error detection 2019-10-11 13:36:58 +02:00
Nikita Popov
f43f493e09 Also check for exception after stream_eof 2019-10-10 12:08:04 +02:00
Nikita Popov
6878c583b0 Report error if stream_read is not implemented
We need to return -1 in this case. Slightly restructure the code
to avoid unnecessary conditions.
2019-10-10 11:13:10 +02:00
Christoph M. Becker
973617cacd Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #78656: Parse errors classified as highest log-level
2019-10-09 17:29:54 +02:00
Christoph M. Becker
bbd481c11d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78656: Parse errors classified as highest log-level
2019-10-09 17:28:50 +02:00
Erik Lundin
3164186d53 Fix #78656: Parse errors classified as highest log-level 2019-10-09 17:27:32 +02:00
Nikita Popov
196f9697ef Merge branch 'PHP-7.3' into PHP-7.4 2019-10-08 12:35:35 +02:00
Nikita Popov
2fdd142f99 Check for exception after applying stream filters
This makes the stream opening actually fail, and avoids assertion
failures when we tokenize with EG(exception) set.

Also avoid throwing an additional warning after an exception has
already been thrown.
2019-10-08 12:32:57 +02:00
Christoph M. Becker
26f45cb4bb 7.3.12 is next 2019-10-08 12:04:25 +02:00
Remi Collet
05d6878b3b next is 7.2.25 2019-10-08 11:36:10 +02:00
Joe Watkins
de83036f13
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #76859 stream_get_line skips data if used with data-generating filter
2019-10-03 06:51:56 +02:00
Joe Watkins
5b1bb23edf
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #76859 stream_get_line skips data if used with data-generating filter
2019-10-03 06:51:10 +02:00
Konstantin Kopachev
05560b67bc
Fix #76859 stream_get_line skips data if used with data-generating filter
stream_get-line repeatedly calls php_stream_fill_read_buffer until
enough data is accumulated in buffer. However, when stream contains
filters attached to it, then each call to fill buffer essentially
resets buffer read/write pointers and new data is written over old.
This causes stream_get_line to skip parts of data from stream
This patch fixes such behavior, so fill buffer call will append.
2019-10-03 06:50:43 +02:00
Nikita Popov
11f3e24190 Fixed bug #78506 2019-09-11 10:27:32 +02:00
Sara Golemon
a270eb1911 Bump for 7.2.24 2019-09-10 13:04:01 -04:00
Christoph M. Becker
cf31210f29 PHP 7.3.10RC1 has been tagged 2019-09-10 15:11:54 +02:00
Christoph M. Becker
73ede6911d Fix version
7.3.10 is next, not 7.3.11.
2019-09-09 15:44:06 +02:00
Stanislav Malyshev
60cfa5781a fix version 2019-09-05 09:54:43 -07:00
Nikita Popov
9ec61e43d4 Fix pipe detection and stream position handling
There are two related changes here:
1. Also check for S_ISCHR/FILE_TYPE_CHAR when checking for pipes, so
   that we detect ttys as well, which are also not seekable.
2. Always set position=-1 (i.e. ftell will return false) when a pipe
   is detected. Previously position=0 was sometimes used, depending on
   whether we're on Windows/Linux and whether the FD or FILE codepath
   was used.
2019-09-05 18:29:15 +02:00
Dmitry Stogov
78aa89a3ee Update PHP_API_VERSION 2019-09-02 19:02:40 +03:00
Nikita Popov
27da21d429 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-30 16:07:54 +02:00