]> granicus.if.org Git - php/log
php
3 years agoReplaced deprecated `hw.ncpu` with `hm. logicalcpu`
Gabriel Caruso [Thu, 7 May 2020 20:55:20 +0000 (22:55 +0200)]
Replaced deprecated `hw.ncpu` with `hm. logicalcpu`

Found that at ziglang/zig#1252.

Closes GH-5541

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Wed, 3 Mar 2021 11:05:03 +0000 (12:05 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix test wrt. server.inc changes

3 years agoFix test wrt. server.inc changes
Christoph M. Becker [Wed, 3 Mar 2021 10:56:03 +0000 (11:56 +0100)]
Fix test wrt. server.inc changes

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Wed, 3 Mar 2021 09:48:43 +0000 (10:48 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #78719: http wrapper silently ignores long Location headers

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Wed, 3 Mar 2021 09:47:09 +0000 (10:47 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #78719: http wrapper silently ignores long Location headers

3 years agoFix #78719: http wrapper silently ignores long Location headers
Christoph M. Becker [Tue, 23 Feb 2021 14:32:54 +0000 (15:32 +0100)]
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.

3 years agoFix bug #80816 Document the removal of alias class entries from ext/spl
Máté Kocsis [Wed, 3 Mar 2021 08:30:37 +0000 (09:30 +0100)]
Fix bug #80816 Document the removal of alias class entries from ext/spl

Closes GH-6748 [skip-ci]

3 years agoAdd const to zend_extension_version_info.build_id
Levi Morrison [Wed, 3 Mar 2021 01:42:58 +0000 (18:42 -0700)]
Add const to zend_extension_version_info.build_id

This is a follow-up to:
https://github.com/php/php-src/commit/3c6ab4b3ea5854fd44a2945bb65bf027a6c94890

Closes GH-6744.

3 years agoFixed bug #80808
Nikita Popov [Tue, 2 Mar 2021 09:58:35 +0000 (10:58 +0100)]
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).

3 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 1 Mar 2021 21:01:01 +0000 (00:01 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)

3 years agoFixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)
Dmitry Stogov [Mon, 1 Mar 2021 20:57:20 +0000 (23:57 +0300)]
Fixed bug #80802: (zend_jit_fetch_indirect_var assert failure with tracing JIT)

3 years agoOptimized object conversion to array without rebulding properties HashTable
Dmitry Stogov [Mon, 1 Mar 2021 19:37:37 +0000 (22:37 +0300)]
Optimized object conversion to array without rebulding properties HashTable

3 years agoOptimized object encoding without rebulding properties HashTable
Dmitry Stogov [Mon, 1 Mar 2021 19:37:05 +0000 (22:37 +0300)]
Optimized object encoding without rebulding properties HashTable

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 1 Mar 2021 17:50:58 +0000 (18:50 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80751: Comma in recipient name breaks email delivery

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 1 Mar 2021 17:50:11 +0000 (18:50 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80751: Comma in recipient name breaks email delivery

3 years agoFix #80751: Comma in recipient name breaks email delivery
Christoph M. Becker [Mon, 1 Mar 2021 15:18:40 +0000 (16:18 +0100)]
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.

3 years agoDeclare XMLReader properties
Máté Kocsis [Sun, 28 Feb 2021 21:15:46 +0000 (22:15 +0100)]
Declare XMLReader properties

Closes GH-6741

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 1 Mar 2021 15:30:19 +0000 (16:30 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80811

3 years agoFixed bug #80811
Nikita Popov [Mon, 1 Mar 2021 14:01:09 +0000 (15:01 +0100)]
Fixed bug #80811

When filling in defaults for skipped params, make sure that
reference parameters get the expected reference wrapper.

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 1 Mar 2021 15:22:51 +0000 (16:22 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Always remove HT iterators, even for uninit HT

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 1 Mar 2021 15:22:29 +0000 (16:22 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Always remove HT iterators, even for uninit HT

3 years agoAlways remove HT iterators, even for uninit HT
Nikita Popov [Mon, 1 Mar 2021 15:20:31 +0000 (16:20 +0100)]
Always remove HT iterators, even for uninit HT

Fixes oss-fuzz #31423.

3 years agoOptimize serializing class names
Tyson Andre [Fri, 26 Feb 2021 14:48:36 +0000 (09:48 -0500)]
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

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 1 Mar 2021 14:13:50 +0000 (15:13 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80805

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 1 Mar 2021 14:13:25 +0000 (15:13 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80805

3 years agoFixed bug #80805
Nikita Popov [Fri, 11 Sep 2020 20:36:41 +0000 (22:36 +0200)]
Fixed bug #80805

Handle missing result_var in binary_op_result_type.

(cherry picked from commit 8446e2827585c37d0739f8d44fa8d359cbbb6551)

3 years agoOptimized object serialization without rebulding properties HashTable
Dmitry Stogov [Mon, 1 Mar 2021 13:10:56 +0000 (16:10 +0300)]
Optimized object serialization without rebulding properties HashTable

3 years agoIncomplete class may have only single "MAGIC_MEMBER"
Dmitry Stogov [Mon, 1 Mar 2021 11:53:30 +0000 (14:53 +0300)]
Incomplete class may have only single "MAGIC_MEMBER"

3 years agoChange the order of properties used in foreach(), var_dump(), serialize(), comparison...
Dmitry Stogov [Mon, 1 Mar 2021 10:43:22 +0000 (13:43 +0300)]
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.

3 years agoAdded UPGRADING note.
Dmitry Stogov [Mon, 1 Mar 2021 10:42:34 +0000 (13:42 +0300)]
Added UPGRADING note.

3 years agoReference dynamic functions through dynamic_defs
Nikita Popov [Mon, 18 May 2020 13:46:06 +0000 (15:46 +0200)]
Reference dynamic functions through dynamic_defs

Currently, dynamically declared functions and closures are inserted
into the function table under a runtime definition key, and then later
possibly renamed. When opcache is not used and a file containing a
closure is repeatedly included, this leads to a very large memory leak,
as the no longer needed closure declarations will never be freed
(https://bugs.php.net/bug.php?id=76982).

With this patch, dynamic functions are instead stored in a
dynamic_func_defs member on the op_array, which opcodes reference
by index. When the parent op_array is destroyed, the dynamic_func_defs
it contains are also destroyed (unless they are stilled used elsewhere,
e.g. because they have been bound, or are used by a live closure). This
resolves the fundamental part of the leak, though doesn't completely
fix it yet due to some arena allocations.

The main non-obvious change here is to static variable handling:
We can't destroy static_variables_ptr in destroy_op_array, as e.g.
that would clear the static variables in a dynamic function when
the op_array containing it is destroyed. Static variable destruction
is separated out for this reason (we already do static variable
destruction separately for normal functions, so we only need to
handle main scripts).

Closes GH-5595.

3 years agoChange the order of properties used for var_dump(), serialize(), comparison, etc.
Dmitry Stogov [Fri, 26 Feb 2021 16:27:55 +0000 (19:27 +0300)]
Change the order of properties used for var_dump(), serialize(), comparison, etc.
Now properties are ordered according to their layout in zend_object structure.

3 years agoFix E_DEPRECATED in zend_vm_gen.php
Max Semenik [Mon, 15 Feb 2021 14:34:41 +0000 (17:34 +0300)]
Fix E_DEPRECATED in zend_vm_gen.php

explode(): Passing null to parameter #2 ($string) of type string is
deprecated

Closes GH-6698.

3 years agorun-tests: drop support for ancient Valgrind versions
Max Semenik [Thu, 25 Feb 2021 10:15:03 +0000 (13:15 +0300)]
run-tests: drop support for ancient Valgrind versions

Valgrind 3.3.0 was released in 2007, not even RHEL has crap older than
this. It could be argued that 3.8.0, released in 2012, could be a safe
cutoff too.

Closes GH-6728.

3 years agoClarify types in XmlReader property handling
Nikita Popov [Mon, 1 Mar 2021 08:54:24 +0000 (09:54 +0100)]
Clarify types in XmlReader property handling

Make it clearer that the specified type is really the only type
that can be returned.

3 years agoRemove useless conditional #ifdef
Patrick Allaert [Fri, 26 Feb 2021 17:33:48 +0000 (18:33 +0100)]
Remove useless conditional #ifdef

Closes GH-6737

Signed-off-by: George Peter Banyard <girgias@php.net>
3 years agoMerge branch 'PHP-8.0'
George Peter Banyard [Sat, 27 Feb 2021 13:14:23 +0000 (13:14 +0000)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix Bug #80800 imap_open() fails when the flags parameter includes CL_EXPUNGE

3 years agoFix Bug #80800 imap_open() fails when the flags parameter includes CL_EXPUNGE
George Peter Banyard [Fri, 26 Feb 2021 03:03:38 +0000 (03:03 +0000)]
Fix Bug #80800 imap_open() fails when the flags parameter includes CL_EXPUNGE

This also affected imap_reopen().
Add a supplementary test that the CL_EXPUNGE flag does have
the intended effect.

Closes GH-6732

3 years agoserialize() optimization
Dmitry Stogov [Fri, 26 Feb 2021 10:30:19 +0000 (13:30 +0300)]
serialize() optimization

3 years agoOptimize out zend_strpprintf() usage for simple concationaton
Dmitry Stogov [Fri, 26 Feb 2021 07:34:30 +0000 (10:34 +0300)]
Optimize out zend_strpprintf() usage for simple concationaton

3 years agoImprove SPL directory and stat() cache using zend_srting* instead of char*
Dmitry Stogov [Thu, 25 Feb 2021 23:28:46 +0000 (02:28 +0300)]
Improve SPL directory and stat() cache using zend_srting* instead of char*

3 years agoMerge branch 'PHP-8.0'
Felipe Pena [Thu, 25 Feb 2021 20:57:30 +0000 (20:57 +0000)]
Merge branch 'PHP-8.0'

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Felipe Pena [Thu, 25 Feb 2021 20:54:24 +0000 (20:54 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

3 years agoFix memleak on ReflectionFunction and ReflectionGenerator classes when calling __cons...
Felipe Pena [Thu, 25 Feb 2021 20:53:14 +0000 (20:53 +0000)]
Fix memleak on ReflectionFunction and ReflectionGenerator classes when calling __construct after instantiation

3 years agoRemove quicktester
George Peter Banyard [Sat, 20 Feb 2021 10:55:02 +0000 (10:55 +0000)]
Remove quicktester

This is barely used and more of a hinderence than anything else

Closes GH-6712

3 years agoMerge branch 'PHP-8.0'
Remi Collet [Thu, 25 Feb 2021 12:54:34 +0000 (13:54 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  skip test with openssl < 1.1.0

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Remi Collet [Thu, 25 Feb 2021 12:54:19 +0000 (13:54 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  skip test with openssl < 1.1.0

3 years agoskip test with openssl < 1.1.0
Remi Collet [Thu, 25 Feb 2021 12:52:35 +0000 (13:52 +0100)]
skip test with openssl < 1.1.0

The test fails, but without any crash
(this test is designed to catch a crash)

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Thu, 25 Feb 2021 11:05:27 +0000 (12:05 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Capture Microsoft-defined HRESULT exit codes exit codes

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Thu, 25 Feb 2021 11:03:43 +0000 (12:03 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Capture Microsoft-defined HRESULT exit codes exit codes

3 years agoCapture Microsoft-defined HRESULT exit codes exit codes
Dylan K. Taylor [Tue, 23 Feb 2021 21:34:51 +0000 (22:34 +0100)]
Capture Microsoft-defined HRESULT exit codes exit codes

The lack of such a check leads to false-passes of tests on Windows
which expect no output, but produce a segfault or similar issue. I
discovered this a while ago due to bad tests in an extension I maintain.

Closes GH-6722.

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 25 Feb 2021 09:19:06 +0000 (10:19 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  crc32 module, clang spurious warning removal.

3 years agocrc32 module, clang spurious warning removal.
David CARLIER [Wed, 24 Feb 2021 20:34:33 +0000 (20:34 +0000)]
crc32 module, clang spurious warning removal.

Closes GH-6725.

3 years agoSpeed up __sleep() and __wakeup() calls
Dmitry Stogov [Thu, 25 Feb 2021 09:16:22 +0000 (12:16 +0300)]
Speed up __sleep() and __wakeup() calls

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 25 Feb 2021 08:52:18 +0000 (09:52 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  mysqlnd pam fix test error message

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 25 Feb 2021 08:52:07 +0000 (09:52 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  mysqlnd pam fix test error message

3 years agomysqlnd pam fix test error message
Daniel Black [Thu, 25 Feb 2021 02:09:08 +0000 (13:09 +1100)]
mysqlnd pam fix test error message

Closes GH-6727.

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 24 Feb 2021 20:31:03 +0000 (21:31 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix potential file collision in dom tests
  Fix bug #80757 (Exit code is 0 when could not open file)
  Update NEWS

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 24 Feb 2021 20:30:44 +0000 (21:30 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix potential file collision in dom tests

3 years agoFix potential file collision in dom tests
Nikita Popov [Wed, 24 Feb 2021 20:30:20 +0000 (21:30 +0100)]
Fix potential file collision in dom tests

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Felipe Pena [Wed, 24 Feb 2021 19:07:22 +0000 (19:07 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

3 years agoFix bug #80757 (Exit code is 0 when could not open file)
Felipe Pena [Wed, 24 Feb 2021 18:17:27 +0000 (18:17 +0000)]
Fix bug #80757 (Exit code is 0 when could not open file)

3 years agoUpdate NEWS
Felipe Pena [Wed, 24 Feb 2021 18:40:32 +0000 (18:40 +0000)]
Update NEWS

3 years agoSwitch few functions useful in Symphony apps to new ZPP API.
Dmitry Stogov [Wed, 24 Feb 2021 16:13:11 +0000 (19:13 +0300)]
Switch few functions useful in Symphony apps to new ZPP API.

3 years agoFixed error message
Dmitry Stogov [Wed, 24 Feb 2021 16:12:32 +0000 (19:12 +0300)]
Fixed error message

3 years agoAllow pointer to end of memory in IS_UNSERIALIZED()
Nikita Popov [Wed, 24 Feb 2021 10:45:25 +0000 (11:45 +0100)]
Allow pointer to end of memory in IS_UNSERIALIZED()

We already use <= for IS_SERIALIZED(), but the same general
problem can also occur for IS_UNSERIALIZED(). We don't seem to
hit this in practice prior to GH-5595 though.

3 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Wed, 24 Feb 2021 09:20:49 +0000 (12:20 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80782 (DASM_S_RANGE_VREG on PHP_INT_MIN-1)

3 years agoFixed bug #80782 (DASM_S_RANGE_VREG on PHP_INT_MIN-1)
Dmitry Stogov [Wed, 24 Feb 2021 09:20:20 +0000 (12:20 +0300)]
Fixed bug #80782 (DASM_S_RANGE_VREG on PHP_INT_MIN-1)

3 years agozend_compile.c: fix typo
Dylan T [Tue, 23 Feb 2021 17:19:21 +0000 (17:19 +0000)]
zend_compile.c: fix typo

Don't mind me, I just happened to be browsing this code. 🙃

Closes GH-6721.

[ci skip]

3 years agorun-tests: add skip cache
Max Semenik [Thu, 11 Feb 2021 17:33:03 +0000 (20:33 +0300)]
run-tests: add skip cache

Currently every --SKIPIF-- section in every test file results in 1
extra execution of PHP, every --EXTENSIONS-- section - in 2 executions.
This is quite wasteful, as skip checking code is extremely repetitive
and extensions are fixed for every binary/ini/command parameters
combination.

This patch adds caching to all such checks.

On my machine, the gains are quite noticeable: 36s instead of 43s
with -j16, 292s instead of 337s without concurrency. Cache stats are
3780 hits, 1247 misses in the latter case. In the future, tests could
be adjusted to have more uniform skip checks to improve performance even
more.

Closes GH-6681.

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Tue, 23 Feb 2021 12:23:22 +0000 (13:23 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  run-tests: fixed exit code not being set on BORKED tests

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Tue, 23 Feb 2021 12:22:25 +0000 (13:22 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  run-tests: fixed exit code not being set on BORKED tests

3 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 23 Feb 2021 12:14:42 +0000 (13:14 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  run-tests: fixed exit code not being set on BORKED tests

3 years agorun-tests: fixed exit code not being set on BORKED tests PHP-7.3
Dylan K. Taylor [Mon, 22 Feb 2021 23:56:11 +0000 (23:56 +0000)]
run-tests: fixed exit code not being set on BORKED tests

When no test paths are specified this shows up when 'make test' is used on a PECL extension without specifying tests to run (or in php-src too, I guess...)

Closes GH-6717.

3 years agoFix Windows build
Nikita Popov [Tue, 23 Feb 2021 11:22:34 +0000 (12:22 +0100)]
Fix Windows build

Don't add to a void pointer.

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Tue, 23 Feb 2021 11:18:03 +0000 (12:18 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Update php_version.h to proper version number

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Tue, 23 Feb 2021 11:16:15 +0000 (12:16 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Update php_version.h to proper version number

3 years agoUpdate php_version.h to proper version number
Christoph M. Becker [Tue, 23 Feb 2021 11:09:06 +0000 (12:09 +0100)]
Update php_version.h to proper version number

3 years agoRemove free_chunk API
Nikita Popov [Tue, 23 Feb 2021 10:46:34 +0000 (11:46 +0100)]
Remove free_chunk API

This API only works in very limited circumstances -- relying on
it will invariably lead to leaks. The correct way to "free" something
from the pool is to use the checkpoint API.

3 years agoRemove resize_chunk API
Nikita Popov [Tue, 23 Feb 2021 10:18:48 +0000 (11:18 +0100)]
Remove resize_chunk API

The last user has been dropped in the previous commit. This has
never worked meaningfully in the first place.

3 years agoFixed bug #80761
Nikita Popov [Tue, 23 Feb 2021 10:14:51 +0000 (11:14 +0100)]
Fixed bug #80761

When row data split across multiple packets, allocate a temporary
buffer that can be reallocated, and only copy into the row buffer
pool arena once we know the final size. This avoids quadratic
memory usage for very large results.

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 23 Feb 2021 09:22:20 +0000 (10:22 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80786

3 years agoFixed bug #80786
Nikita Popov [Tue, 23 Feb 2021 09:17:30 +0000 (10:17 +0100)]
Fixed bug #80786

Don't use r0 as temporary register in math_double_long if it is
already used for a memory result.

This was already done in one branch, but not the other.

3 years agoFixed bug #80724
Cameron Porter [Mon, 15 Feb 2021 04:55:25 +0000 (22:55 -0600)]
Fixed bug #80724

FilesystemIterator::FOLLOW_SYMLINKS is currently treated as a directory
key mode flag, even though it does not change the way that the key
during iteration is set. To address this, FOLLOW_SYMLINKS has been
converted into an OTHER flag.

Closes GH-6695.

3 years agoFix #80329: Add option to specify LOAD DATA LOCAL white list folder
Darek Slusarczyk [Mon, 22 Feb 2021 10:03:24 +0000 (11:03 +0100)]
Fix #80329: Add option to specify LOAD DATA LOCAL white list folder

 * allow the user to specify a folder where files that can be sent
   via LOAD DATA LOCAL can exist
 * add mysqli.local_infile_directory for mysqli
   (ignored if mysqli.allow_local_infile is enabled)
 * add PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY for pdo_mysql
   (ignored if PDO::MYSQL_ATTR_LOCAL_INFILE is enabled)
 * add related tests
 * fixes for building with libmysql 8.x
 * small improvement in existing tests
 * update php.ini-[development|production] files

Closes GH-6448.

Co-authored-by: Nikita Popov <nikic@php.net>
3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 22 Feb 2021 14:33:57 +0000 (15:33 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #75776: Flushing streams with compression filter is broken

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 22 Feb 2021 14:31:49 +0000 (15:31 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #75776: Flushing streams with compression filter is broken

3 years agoFix #75776: Flushing streams with compression filter is broken
Christoph M. Becker [Tue, 16 Feb 2021 18:36:37 +0000 (19:36 +0100)]
Fix #75776: Flushing streams with compression filter is broken

First, the `bzip2.compress` filter has the same issue as `zlib.deflate`
so we port the respective fix[1] to ext/bz2.

Second, there is still an issue, if a stream with an attached
compression filter is flushed before it is closed, without any writes
in between.  In that case, the compression is never finalized.  We fix
this by enforcing a `_php_stream_flush()` with the `closing` flag set
in `_php_stream_free()`, whenever a write filter is attached.  This
call is superfluous for most write filters, but does not hurt, even
when it is unnecessary.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=20e75329f2adb11dd231852c061926d0e4080929>

Closes GH-6703.

3 years agoGenerate class entries from stubs for com, standard, xmlreader, xmlwriter, xsl, zip...
Máté Kocsis [Wed, 17 Feb 2021 12:42:42 +0000 (13:42 +0100)]
Generate class entries from stubs for com, standard, xmlreader, xmlwriter, xsl, zip, Zend

Closes GH-6706

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 22 Feb 2021 13:34:45 +0000 (14:34 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 22 Feb 2021 13:33:49 +0000 (14:33 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI

3 years agoFix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI
Christoph M. Becker [Mon, 22 Feb 2021 11:24:15 +0000 (12:24 +0100)]
Fix #80771: phpinfo(INFO_CREDITS) displays nothing in CLI

There is no good reason not to show the credits in text based SAPIs,
except for brevity.  Thus, we suppress the credits from `php -i`.

Closes GH-6710.

3 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 22 Feb 2021 11:36:43 +0000 (12:36 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80774: session_name() problem with backslash

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 22 Feb 2021 11:34:54 +0000 (12:34 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80774: session_name() problem with backslash

3 years agoFix #80774: session_name() problem with backslash
Christoph M. Becker [Fri, 19 Feb 2021 12:14:26 +0000 (13:14 +0100)]
Fix #80774: session_name() problem with backslash

Since we do no longer URL decode cookie names[1], we must not URL
encode the session name.  We need to prevent broken Set-Cookie headers,
by rejecting names which contain invalid characters.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=6559fe912661ca5ce5f0eeeb591d928451428ed0>

Closes GH-6711.

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 22 Feb 2021 09:33:16 +0000 (10:33 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix trampoline leak on dynamic static call of non-static method

3 years agoFix trampoline leak on dynamic static call of non-static method
Nikita Popov [Mon, 22 Feb 2021 09:32:28 +0000 (10:32 +0100)]
Fix trampoline leak on dynamic static call of non-static method

Fixes oss-fuzz #30317.

3 years agoDon't resolve special class names
Nikita Popov [Mon, 22 Feb 2021 09:09:28 +0000 (10:09 +0100)]
Don't resolve special class names

Adjust zend_resolve_class_name() to not resolve special class names.
This avoids the need to only call this function after a preliminary
check for non-default fetch types. Doing so is somewhat fragile
when dynamic class names are involved.

Fixes oss-fuzz #31139.

3 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 22 Feb 2021 08:38:44 +0000 (09:38 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80781

3 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 22 Feb 2021 08:37:51 +0000 (09:37 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80781