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

122451 Commits

Author SHA1 Message Date
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
5d612ae35f [ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  7.3.30 is next
2021-06-29 14:30:49 +02:00
Christoph M. Becker
40332bee1e [ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.30 is next
2021-06-29 14:20:02 +02:00
Christoph M. Becker
53ea910d17 7.3.30 is next 2021-06-29 14:14:53 +02:00
Christoph M. Becker
fa177a8d0f Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  [ci skip] Fix NEWS format
2021-06-29 10:33:03 +02:00
Christoph M. Becker
b6130dd464 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Fix NEWS format
2021-06-29 10:31:47 +02:00
Christoph M. Becker
f5cba2d491 [ci skip] Fix NEWS format 2021-06-29 10:28:35 +02:00
Christoph M. Becker
178a8bd1cc Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix warning
2021-06-28 14:42:50 +02:00
Stanislav Malyshev
7bab67c2d0 Fix warning
(cherry picked from commit 190013787b)
2021-06-28 14:41:33 +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
Stanislav Malyshev
190013787b Fix warning 2021-06-27 21:57:58 -07:00
Stanislav Malyshev
892674ef70 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Update NEWS
  Fix #76448: Stack buffer overflow in firebird_info_cb
  Fix #76449: SIGSEGV in firebird_handle_doer
  Fix #76450: SIGSEGV in firebird_stmt_execute
  Fix #76452: Crash while parsing blob data in firebird_fetch_blob
  Fix #81122: SSRF bypass in FILTER_VALIDATE_URL
2021-06-27 21:39:23 -07:00
Stanislav Malyshev
2327e3d36a Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Update NEWS
  Fix #76448: Stack buffer overflow in firebird_info_cb
  Fix #76449: SIGSEGV in firebird_handle_doer
  Fix #76450: SIGSEGV in firebird_stmt_execute
  Fix #76452: Crash while parsing blob data in firebird_fetch_blob
  Fix #81122: SSRF bypass in FILTER_VALIDATE_URL
2021-06-27 21:36:55 -07:00
Stanislav Malyshev
c68a687566 Update NEWS 2021-06-20 22:20:38 -07:00
Christoph M. Becker
67afa32541 Fix #76448: Stack buffer overflow in firebird_info_cb
We ensure not to overflow the stack allocated buffer by using `strlcat`.
2021-06-20 22:01:06 -07:00
Christoph M. Becker
08da7c7372 Fix #76449: SIGSEGV in firebird_handle_doer
We need to verify that the `result_size` is not larger than our buffer,
and also should make sure that the `len` which is passed to
`isc_vax_integer()` has a permissible value; otherwise we bail out.
2021-06-20 21:59:51 -07:00
Christoph M. Becker
bcbf8aa0c9 Fix #76450: SIGSEGV in firebird_stmt_execute
We need to verify that the `result_size` is not larger than our buffer,
and also should make sure that the `len` which is passed to
`isc_vax_integer()` has a permissible value; otherwise we bail out.
2021-06-20 21:59:37 -07:00
Christoph M. Becker
286162e9b0 Fix #76452: Crash while parsing blob data in firebird_fetch_blob
We need to prevent integer overflow when calling `erealloc()` with
`len+1`.
2021-06-20 21:56:07 -07:00
Christoph M. Becker
a5538c6229 Fix #81122: SSRF bypass in FILTER_VALIDATE_URL
We need to ensure that the password detected by parse_url() is actually
a valid password; we can re-use is_userinfo_valid() for that.
2021-06-20 21:49:49 -07: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
ad2d9d9804 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  NEWS: Add bug #81101 note
2021-06-19 16:52: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
Anatol Belski
f7ab7951f1 pcre: Workaround bug #81101
The way to fix it is to disable certain match start optimizaions. The
observed performance impact appears negligible ATM, compared to the
functional regression revealed.

A possible side effect might occur if a pattern uses (*COMMIT) or
(*MARK), which is however not a very broadly used syntax in PHP. Still
this should be observed and handled by possibly adding a possibility to
reverse PCRE2_NO_START_OPTIMIZE on the user side.

One test shows a behavior change, where instead of int 0 the match
would produce an error and return false. Except strict comparison
is used, this should be acceptable.

Signed-off-by: Anatol Belski <ab@php.net>
(cherry picked from commit d188ca7688)
Signed-off-by: Anatol Belski <ab@php.net>
2021-06-19 15:25:17 +02:00
Anatol Belski
ed431ea2f6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  pcre: Workaround bug #81101
2021-06-19 15:24:50 +02:00
Anatol Belski
1a1d86d562 pcre: Workaround bug #81101
The way to fix it is to disable certain match start optimizaions. The
observed performance impact appears negligible ATM, compared to the
functional regression revealed.

A possible side effect might occur if a pattern uses (*COMMIT) or
(*MARK), which is however not a very broadly used syntax in PHP. Still
this should be observed and handled by possibly adding a possibility to
reverse PCRE2_NO_START_OPTIMIZE on the user side.

One test shows a behavior change, where instead of int 0 the match
would produce an error and return false. Except strict comparison
is used, this should be acceptable.

Signed-off-by: Anatol Belski <ab@php.net>
(cherry picked from commit d188ca7688)
Signed-off-by: Anatol Belski <ab@php.net>
2021-06-19 15:23:43 +02:00
George Peter Banyard
351629ae15 Fix test
This seems to only be incorrect for the 8.0 branch
2021-06-18 18:09:27 +01: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
3374adcd14 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix test in case fallocate(1) is available, but fails
2021-06-17 19:06:18 +02:00
Christoph M. Becker
99e7c5cea8 Fix test in case fallocate(1) is available, but fails
That happens on Travis s390x for whatever reasons.  Thus, instead of
checking for `fallocate -h`, we attempt the real allocation and skip if
that fails.
2021-06-17 19:05:07 +02:00
Dmitry Stogov
ced8e88438 JIT/x86: Fixed possible incorrect register allocation 2021-06-17 18:42:11 +03:00
Dmitry Stogov
1082669e24 JIT: Fixed failures of tracing JIT with CALL VM
This fixes:
- tests/lang/bug28800.phpt
- Zend/tests/settype_resource.phpt
- Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
2021-06-17 14:21:40 +03: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
Dmitry Stogov
df16fd149b Fixed incorrect type inference for "(array)$null". 2021-06-17 13:03:09 +03: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
Derick Rethans
77bfe96109 Merge branch 'PHP-7.4' into PHP-8.0 2021-06-15 19:52:14 +01:00
Derick Rethans
8370a084e4 Prepare for 7.4.22 2021-06-15 19:52:02 +01:00
Gabriel Caruso
b81c3b5b1c Prepare for PHP 8.0.9 2021-06-15 09:19:13 +02:00
Nikita Popov
b6fa386749 Regenerate arginfo file 2021-06-14 10:59:18 +02:00
Nikita Popov
5dc31e0cb6 Fixed bug #80197
Use "libmagic/magic.h" rather than <magic.h> to make sure that we
use the bundled libmagic, even if there is a system libmagic on the
include path.
2021-06-14 10:59:13 +02:00
Christoph M. Becker
876bf8800a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix test wrt. OPENSSL_CONF
2021-06-13 16:54:52 +02:00
Christoph M. Becker
d15e10d7ab Fix test wrt. OPENSSL_CONF
This test is supposed to verify the path of the default OpenSSL config
file; it will fail, though, if OPENSSL_CONF is explicitly set, so we
explicitly unset this environment variable for this test.
2021-06-13 16:53:45 +02:00
Joe Watkins
b10bcb4faa fix bad refactor of #7136 2021-06-11 09:33:55 +02:00
Joe Watkins
ca6f3f62f2 Merge branch '7136' into PHP-8.0
* 7136:
  Enable net_get_interfaces on IBM i PASE
2021-06-11 09:13:34 +02:00
Calvin Buckley
4f51a11a84 Enable net_get_interfaces on IBM i PASE
On IBM i, getifaddrs is available renamed as Qp2getifaddrs; freeifaddrs
and struct ifaddr follow a similar fate. I assume this is in case AIX
decides to add it (as if). As such, just use the same implementation,
but rename the standard ones to the IBM i definitions and include its
header.
2021-06-11 09:12:49 +02:00