Commit Graph

13157 Commits

Author SHA1 Message Date
Dmitry Stogov
a9991fbf28 Fixed Bug #80959 (infinite loop in building cfg during JIT compilation) 2021-07-21 14:32:44 +03:00
Dmitry Stogov
02acc5ad3b Fixed Bug #81255 (Memory leak in PHPUnit with functional JIT) 2021-07-20 22:14:32 +03:00
Nikita Popov
051ff33660 Fix bug #81272: Fix func info for functions returning EMPTY_ARRAY
The empty array has refcount > 1, so we should indicate this in
func info. In most cases this renders the func info redundant,
so drop it entirely.
2021-07-20 14:40:17 +02:00
Christoph M. Becker
18abfcb306
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Revert "Fix #79908: json_encode encodes negative zero as int"
2021-07-20 00:28:27 +02:00
Christoph M. Becker
2d2c001ca5
Revert "Fix #79908: json_encode encodes negative zero as int"
This reverts commit 717f1ed5e4.
2021-07-20 00:25:50 +02:00
Christoph M. Becker
ef77d3c89f
Fix #81206: Multiple PHP processes crash with JIT enabled
We need to avoid resetting the JIT for all SAPIs, but we need to
initialize the JIT handlers even when only reattaching on Windows.

Closes GH-7208.
2021-07-19 23:45:37 +02:00
Dmitry Stogov
c0e4932816 Fixed bug #81249 (Intermittent property assignment failure with JIT enabled) 2021-07-19 12:11:09 +03:00
Dmitry Stogov
9cd437138e Fixed bug #81225 (Wrong result with pow operator with JIT enabled) 2021-07-19 10:39:52 +03:00
Christoph M. Becker
9fbcaa57aa
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #78238: BCMath returns "-0"
2021-07-16 15:56:15 +02:00
Christoph M. Becker
bcb89c75ec
Fix #78238: BCMath returns "-0"
There is no negative zero in the decimal system, so we must suppress
the sign.

Closes GH-7250.
2021-07-16 15:54:24 +02:00
Nikita Popov
12a858ac95 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #81265: getimagesize returns 0 for 256px ICO images
2021-07-16 10:07:26 +02:00
George Dietrich
8f97f82e35 Fix bug #81265: getimagesize returns 0 for 256px ICO images
Set ICO height/width to 256 if 0.
2021-07-16 10:05:58 +02:00
Christoph M. Becker
bb4dbbc150
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80849: HTTP Status header truncation
2021-07-15 19:13:58 +02:00
Christoph M. Becker
a054ef2aad
Fix #80849: HTTP Status header truncation
While truncating the contents of a header is okay, we must never omit
the trailing CRLF.

Closes GH-7238.
2021-07-15 19:10:53 +02:00
Christoph M. Becker
c6b7f6c39f
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #72595: php_output_handler_append illegal write access
2021-07-15 15:29:48 +02:00
Christoph M. Becker
a942cf5b02
Fix #72595: php_output_handler_append illegal write access
We must make sure that `handler->buffer.size + grow_max` does not
overflow, so we're using `safe_erealloc()` instead.

Closes GH-7241.
2021-07-15 15:26:42 +02:00
Christoph M. Becker
c0a1ef3e32
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #72146: Integer overflow on substr_replace
2021-07-15 12:56:12 +02:00
Christoph M. Becker
33f8dfb15a
Fix #72146: Integer overflow on substr_replace
Adding two `zend_long`s may overflow, and casting `size_t` to
`zend_long` may truncate; we can avoid this here by enforcing unsigned
arithmetic.

Closes GH-7240.
2021-07-15 12:54:28 +02:00
Derick Rethans
f40dcedb48 Update NEWS for 7.4.22 2021-07-13 17:21:34 +01:00
Sara Golemon
7dc35ac8a7
Bump to 8.0.10 2021-07-13 14:10:35 +00:00
Christoph M. Becker
1ba190bdb3
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #79908: json_encode encodes negative zero as int
2021-07-13 15:32:32 +02:00
Christoph M. Becker
717f1ed5e4
Fix #79908: json_encode encodes negative zero as int
Encoding a negative zero as `-0` is likely to loose the sign when
decoding (at least it does with `json_decode()`).  Therefore, we encode
it as if `JSON_PRESERVE_ZERO_FRACTION` was specified, i.e. as `-0.0`.

Closes GH-7234.
2021-07-13 15:31:07 +02:00
Christoph M. Becker
0c0ecf0470
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #73226: --r[fcez] always return zero exit code
2021-07-12 23:12:19 +02:00
Christoph M. Becker
9db3eda2cb
Fix #73226: --r[fcez] always return zero exit code
This makes the behavior consistent with `--ri`, and is likely useful
for scripting.

Closes GH-7221.
2021-07-12 23:09:28 +02:00
Christoph M. Becker
5fb5a739e2
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81243: Too much memory is allocated for preg_replace()
2021-07-12 18:35:49 +02:00
Christoph M. Becker
a6b43086e6
Fix #81243: Too much memory is allocated for preg_replace()
Trimming a potentially over-allocated string appears to be reasonable,
so we drop the condition altogether.

We also re-allocate twice the size needed in the first place, and not
roughly tripple the size.

Closes GH-7231.
2021-07-12 18:33:55 +02:00
Christoph M. Becker
d776413f0b
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81223: flock() only locks first byte of file
2021-07-06 12:00:09 +02:00
Christoph M. Becker
520c00a5bf
Fix #81223: flock() only locks first byte of file
`flock()` should lock the whole file, like on other systems which use
mandatory locking.  We cannot use `0` like for `flck.l_len`, so we use
the largest number, what is valid according to the documentation:
<https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-lockfileex#remarks>.

Closes GH-7216.
2021-07-06 11:58:02 +02:00
Christoph M. Becker
8071bd2faf
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #74264: grapheme_strrpos() broken for negative offsets
2021-07-05 18:15:24 +02:00
Christoph M. Becker
28c9376306
Fix #74264: grapheme_strrpos() broken for negative offsets
We must not assume that `usearch_last()` gives the proper result for
negative offsets.  Instead we'd need to continue to search backwards
(`usearch_previous`) until we find a proper match.  However, apparently
searching backwards is broken, so we work around by searching forward
from the start of the string until we pass the `offset_pos`, and then
use the previous result.

Closes GH-7189.
2021-07-05 18:11:30 +02:00
Nikita Popov
4e66e6a73a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80173
2021-07-02 10:08:40 +02:00
Nikita Popov
bdc60fa7da Fixed bug #80173
The analysis in the bug report wasn't correct (at least not in
this case -- there may still be a more general problem here),
the issue was that write_property returned the original variable_ptr
rather than the zend_assign_to_variable() return value, which will
DEREF the variable before overwriting it.
2021-07-02 10:07:40 +02:00
Christoph M. Becker
5b0a46908c
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #52093: openssl_csr_sign truncates $serial
2021-07-01 15:43:52 +02:00
Christoph M. Becker
334387bb70
Fix #52093: openssl_csr_sign truncates $serial
We use `ASN1_INTEGER_set_int64()` if supported[1], to avoid the
truncation of the integer.

[1] <https://www.openssl.org/docs/man1.1.0/man3/ASN1_INTEGER_set_int64.html#HISTORY>

Closes GH-7209.
2021-07-01 15:42:02 +02:00
Nikita Popov
b976bc44f1 Fixed bug #81208
The number of populated positional arguments is argc. i may also
include named args and thus try to dtor uninitialized zvals.
2021-07-01 13:36:57 +02:00
Christoph M. Becker
70b0330e53
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #73630: Built-in Weberver - overwrite $_SERVER['request_uri']
2021-06-30 16:15:50 +02:00
Christoph M. Becker
d7db5701a3
Fix #73630: Built-in Weberver - overwrite $_SERVER['request_uri']
The built-in Webserver's `on_path`, `on_query_string` and `on_url`
callbacks may be called multiple times from the parser; we must not
simply replace the old values, but need to concatenate the new values
instead.

This appears to be tricky for `on_path` due to the path normalization,
so we fail if the function is called again.

The built-in Webserver logs errors during request parsing to stderr,
but this is ignored by the php_cli_server framework, and apparently the
Webserver does not send a resonse at all in such cases (instead of an
4xx).  Thus we can only check that a request with an overly long path
fails.

Closes GH-7207.
2021-06-30 16:13:08 +02:00
Nikita Popov
65bd8d281f Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #80728: Don't reset the timeout on ini deactivate
2021-06-29 16:37:27 +02:00
Calvin Buckley
98a21d1dfb Fix bug #80728: Don't reset the timeout on ini deactivate
When the time limit for a script is changed, when the script ends,
its INI value will be reset. This calls the event handler for the
timeout change, which will unset then reset the timeout. However,
this is done even if the script is done executing, and say, the CGI
or CLI web server process is idle.

This is probably incorrect, but isn't a problem on most platforms,
because PHP uses a timer that only ticks when the process is active
(that is, executing code). Since when it's idle, it's blocking on
listen/read, it won't tick because nothing executes. However, on
platforms where only the real-time timer is supported, (Cygwin/PASE)
it ticks regardless of if PHP is even executing. This means that the
idle processes are subject to timeouts from the INI reset on script
end.

This makes it so the timer is never set if the state is deactivating.
Testing with the CLI web server indicates the timer no longer
spuriously activates under PASE.

Closes GH-6683.
2021-06-29 16:36:46 +02:00
Christoph M. Becker
1bf2b04b26
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #68471: IntlDateFormatter fails for "GMT+00:00" timezone
2021-06-28 13:55:56 +02:00
Christoph M. Becker
1a01f7816c
Fix #68471: IntlDateFormatter fails for "GMT+00:00" timezone
GMT+00:00 is recognized by ICU, and is normalized to GMT.  There are no
issues when GMT+00:00 is passed to `IntlTimeZone::createTimeZone()`,
but passing it to IntlDateFormatter::__construct() causes a failure,
since there is an additional check regarding the validity.  While
checking the validity of the result of `TimeZone::createTimeZone()`[1]
is a good idea, comparing the IDs is overly restrictive.  Instead we
just check that the timezone is supported by ICU.

[1] <https://unicode-org.github.io/icu-docs/apidoc/dev/icu4c/classicu_1_1TimeZone.html#a35da0507b62754ffe5d8d59c19775cdb>

Closes GH-7190.
2021-06-28 13:54:22 +02:00
Anatol Belski
2b948720ab
NEWS: Add bug #81101 note
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2021-06-19 16:54:11 +02:00
Anatol Belski
4d8eb892b9
NEWS: Add bug #81101 note
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2021-06-19 16:51:13 +02:00
George Peter Banyard
f0fd5922ee
Fix bug #81159: Object to int warning when using an object as a string offset
Closes GH-7167
2021-06-18 18:07:22 +01:00
Joe Watkins
7bf930d014
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #81163 indirect vars in __sleep
2021-06-18 11:17:03 +02:00
Joe Watkins
bc59b046c6
Fix bug #81163 indirect vars in __sleep 2021-06-18 11:16:26 +02:00
Christoph M. Becker
8daed6d0f2
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81145: copy() and stream_copy_to_stream() fail for +4GB files
2021-06-17 13:16:30 +02:00
Christoph M. Becker
2555efadbc
Fix #81145: copy() and stream_copy_to_stream() fail for +4GB files
When mapping the file, we need to pass the proper `dwFileOffsetHigh`
instead of `0`.

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

Closes GH-7158.
2021-06-17 13:13:47 +02:00
Christoph M. Becker
13f3999a77
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #72809: Locale::lookup() wrong result with canonicalize option
2021-06-16 10:36:51 +02:00
Christoph M. Becker
0f1b17e378
Fix #72809: Locale::lookup() wrong result with canonicalize option
Canonicalization converts the locale to ICU format[1].  However, the
lookup described in RFC 4647, section 3.4, is about POSIX format.  To
make that lookup work for ICU format, we also need to cater to keyword
separators.

The results are somewhat unexpected, but apparently canonical lookup is
explicitly supposed to return canonical language tags[2].

[1] <https://unicode-org.github.io/icu/userguide/locale/#canonicalization>
[2] <https://github.com/php/php-src/blob/php-7.4.20/ext/intl/locale/locale_methods.c#L1504>

Closes GH-7151.
2021-06-16 10:33:59 +02:00