]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 11 Nov 2020 11:48:44 +0000 (12:48 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix double free when socket_accept fails

4 years agoFix double free when socket_accept fails
Nikita Popov [Wed, 11 Nov 2020 11:48:25 +0000 (12:48 +0100)]
Fix double free when socket_accept fails

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 11 Nov 2020 10:56:39 +0000 (11:56 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Retain reference to share handle from curl handle

4 years agoRetain reference to share handle from curl handle
Nikita Popov [Wed, 11 Nov 2020 10:51:20 +0000 (11:51 +0100)]
Retain reference to share handle from curl handle

Not keeping a reference will not result in use after free, because
curl protects against it, but it will result in a memory leak,
because curl_share_cleanup() will fail. We should make sure that
the share handle object stays alive as long as the curl handles
use it.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Wed, 11 Nov 2020 10:51:07 +0000 (13:51 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  [Observer+JIT] Save opline before calling begin/end handlers

4 years ago[Observer+JIT] Save opline before calling begin/end handlers
Dmitry Stogov [Wed, 11 Nov 2020 10:50:53 +0000 (13:50 +0300)]
[Observer+JIT] Save opline before calling begin/end handlers

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Wed, 11 Nov 2020 10:07:12 +0000 (13:07 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  [Observer] Save opline before calling begin/end handlers

4 years ago[Observer] Save opline before calling begin/end handlers
Dmitry Stogov [Wed, 11 Nov 2020 10:06:55 +0000 (13:06 +0300)]
[Observer] Save opline before calling begin/end handlers

4 years agoConsolidate all single-byte encodings in one source file
Alex Dowad [Tue, 3 Nov 2020 07:57:41 +0000 (09:57 +0200)]
Consolidate all single-byte encodings in one source file

We can squeeze out a lot of duplicated code in this way.

4 years agoEnhance mbstring support for UCS-2 text
Alex Dowad [Fri, 4 Sep 2020 20:17:59 +0000 (22:17 +0200)]
Enhance mbstring support for UCS-2 text

- For consistency with UTF-16, UTF-32, and UCS-4, strip leading byte
  order marks.
- Treat it as an error if string is truncated (i.e. has an odd number
  of bytes).

4 years agoLeading BOM is stripped for UTF-32
Alex Dowad [Fri, 4 Sep 2020 20:21:20 +0000 (22:21 +0200)]
Leading BOM is stripped for UTF-32

For consistency with UTF-16 and UCS-4.

Also, do some code cleanup.

4 years agoAdd test suite for SJIS-mac encoding
Alex Dowad [Wed, 9 Sep 2020 18:02:46 +0000 (20:02 +0200)]
Add test suite for SJIS-mac encoding

4 years agoUnicode -> SJIS-mac conversion doesn't reject valid codepoints after a bad transcodin...
Alex Dowad [Mon, 9 Nov 2020 19:40:08 +0000 (21:40 +0200)]
Unicode -> SJIS-mac conversion doesn't reject valid codepoints after a bad transcoding hint

To give the background on this issue, here is an excerpt from JAPANESE.txt,
from the Unicode Consortium:

    Apple has defined a block of 32 corporate characters as "transcoding
    hints." These are used in combination with standard Unicode characters
    to force them to be treated in a special way for mapping to other
    encodings; they have no other effect. Sixteen of these transcoding
    hints are "grouping hints" - they indicate that the next 2-4 Unicode
    characters should be treated as a single entity for transcoding. The
    other sixteen transcoding hints are "variant tags" - they are like
    combining characters, and can follow a standard Unicode (or a sequence
    consisting of a base character and other combining characters) to
    cause it to be treated in a special way for transcoding. These always
    terminate a combining-character sequence.

    The transcoding coding hints used in this mapping table are:

    0xF860  group next 2 characters as a single entity for transcoding
    0xF861  group next 3 characters as a single entity for transcoding
    0xF862  group next 4 characters as a single entity for transcoding
    0xF87A  variant tag for "negative" (i.e. black & white reversed)
    0xF87E  variant tag for vertical form
    0xF87F  variant tag for other alternate form

    For example, the Apple addition character 0x85AB is Roman numeral
    thirteen. There is no single Unicode for this (although there are
    standard Unicodes for Roman numerals 1-12). Using the grouping hint
    0xF862 in combination with standard Unicodes, we can map this as
    0xF862+0x0058+0x0049+0x0049+0x0049 (i.e. X + I + I + I).

Our SJIS-mac conversion code actually recognizes some special sequences
which start with an Apple 'transcoding hint'. However, if a transcoding
hint is misplaced and is not followed by one of the expected sequences,
we can just emit one error marker for the bad transcoding hint and then
process the following codepoint as normal.

4 years agoSJIS-mac encoding conversion: Stop the carnage of innocent Unicode codepoints
Alex Dowad [Sat, 19 Sep 2020 13:16:51 +0000 (15:16 +0200)]
SJIS-mac encoding conversion: Stop the carnage of innocent Unicode codepoints

When converting Unicode to MacJapanese, some special sequences of Unicode
codepoints are collapsed into a single SJIS character. When the implementation
sees a codepoint which *might* begin such a sequence, it is cached and examined
again after the next codepoint arrives.

If it turns out that it wasn't one of the 'special' sequences, then a 'fallback'
conversion table is consulted to convert the cached codepoint. Then we re-enter
the regular conversion code to convert the immediately following codepoint.
BUT, local variables need to be reinitialized properly when doing this!

Because the locals weren't reinitialized, the sad result was that some codepoints
would get chopped up into bit salad and emitted as something totally bogus
(which might not even be valid SJIS-mac text at all).

4 years agoConvert Unicode halfwidth Yen sign to MacJapanese halfwidth Yen sign
Alex Dowad [Sat, 19 Sep 2020 12:27:14 +0000 (14:27 +0200)]
Convert Unicode halfwidth Yen sign to MacJapanese halfwidth Yen sign

Since 1993, Unicode has had a specific codepoint for a fullwidth Yen sign.
Likewise, MacJapanese has separate kuten codes for halfwidth and fullwidth
Yen signs. But mbstring mapped _both_ Yen sign codepoints to the
MacJapanese fullwidth Yen sign.

It's probably more appropriate to map the 'ordinary' Yen sign to the
MacJapanese halfwidth Yen sign. Besides, this means that the conversion
between Unicode and MacJapanese is closer to being lossless and reversible.

4 years agoSJIS-mac encoding conversion: handle invalid (or truncated) 2nd byte for Kanji correctly
Alex Dowad [Wed, 9 Sep 2020 19:18:54 +0000 (21:18 +0200)]
SJIS-mac encoding conversion: handle invalid (or truncated) 2nd byte for Kanji correctly

Also, don't accept 1st bytes above 0xED, since none of the possible 2-byte
sequences starting with 0xEE and above are actually mapped to any character.

4 years agoAdd test suite for SJIS-2004 encoding
Alex Dowad [Tue, 8 Sep 2020 20:14:36 +0000 (22:14 +0200)]
Add test suite for SJIS-2004 encoding

4 years agoDon't mangle non-Japanese chars which appear after a 'combining' kana in SJIS-2004
Alex Dowad [Thu, 17 Sep 2020 20:34:59 +0000 (22:34 +0200)]
Don't mangle non-Japanese chars which appear after a 'combining' kana in SJIS-2004

Unicode has 'combining' characters which join with another following character.
Japanese hiragana and katakana with the 'two dots' voice mark can be represented
in this way, with one Unicode character for the 'base' kana and another one which
adds the voice mark.

In SJIS-2004, however, there are dedicated characters for voiced and unvoiced
kana. So some special checks are done to identify sequences of Unicode characters
which need to be 'collapsed' into a single SJIS-2004 character.

If a kana is immediately followed by some other unrelated character, like a
Cyrillic letter, then the cached kana should be output 'as is' and we
proceed with encoding the unrelated character. When doing this, though,
we need to re-initialize local variables, or else the unrelated character
will be mangled in some cases.

4 years agoSJIS-2004 encoding conversion: handle invalid (or truncated) 2nd byte for Kanji correctly
Alex Dowad [Tue, 8 Sep 2020 20:57:28 +0000 (22:57 +0200)]
SJIS-2004 encoding conversion: handle invalid (or truncated) 2nd byte for Kanji correctly

If the 2nd byte of a 2-byte character is invalid, then mb_substitute_character()
should be respected. Instead, what mbstring was doing was 'swallowing' the
first byte, then emitting the 2nd byte as if it was an ASCII character.

Likewise, if the 2nd byte is missing, instead of just keeping quiet, report an
illegal character as specified by mb_substitute_character().

4 years agoFix broken binary search function in mbstring
Alex Dowad [Mon, 9 Nov 2020 19:37:04 +0000 (21:37 +0200)]
Fix broken binary search function in mbstring

This faulty binary search would never reject values at the very high
end of the range being searched, even if they were not actually in
the table.

Among other things, this meant that some Unicode codepoints which do
not correspond to any character in JIS X 0213 would be converted to
bogus Shift-JIS-2004 values rather than being rejected.

4 years agoDon't redundantly flush mbstring filters multiple times
Alex Dowad [Mon, 9 Nov 2020 19:33:32 +0000 (21:33 +0200)]
Don't redundantly flush mbstring filters multiple times

Each flush function in a chain of mbstring conversion filters always
calls the next flush function in the chain. So it is not necessary to
explicitly flush the second filter in a chain. (Due to this bug, in many
cases, flush functions were actually being called three times.)

4 years agoTest EUC-JP and Shift-JIS more thoroughly
Alex Dowad [Mon, 9 Nov 2020 20:59:07 +0000 (22:59 +0200)]
Test EUC-JP and Shift-JIS more thoroughly

Previously, the unit tests for these text encodings covered all mappings
from legacy -> Unicode, and all _reversible_ mappings from Unicode -> legacy.
However, we should also test the few Unicode -> legacy mappings which
are not reversible.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 11 Nov 2020 08:28:44 +0000 (09:28 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix community job

4 years agoFix community job
Nikita Popov [Wed, 11 Nov 2020 08:28:20 +0000 (09:28 +0100)]
Fix community job

Made a mistake while merging...

4 years agoMerge branch 'PHP-8.0'
Derick Rethans [Tue, 10 Nov 2020 17:58:50 +0000 (17:58 +0000)]
Merge branch 'PHP-8.0'

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Derick Rethans [Tue, 10 Nov 2020 17:58:38 +0000 (17:58 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoPHP-7.4 is now for 7.4.14
Derick Rethans [Tue, 10 Nov 2020 17:58:21 +0000 (17:58 +0000)]
PHP-7.4 is now for 7.4.14

4 years agoUpdate NEWS for 8.0.0
Gabriel Caruso [Tue, 10 Nov 2020 11:02:35 +0000 (11:02 +0000)]
Update NEWS for 8.0.0

4 years agoUpdate NEWS for PHP 8.0.0RC4
Gabriel Caruso [Tue, 10 Nov 2020 10:52:13 +0000 (10:52 +0000)]
Update NEWS for PHP 8.0.0RC4

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 10 Nov 2020 10:46:07 +0000 (11:46 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Add integration test for symfony preloading

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 10 Nov 2020 10:45:59 +0000 (11:45 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Add integration test for symfony preloading

4 years agoAdd integration test for symfony preloading
Nikita Popov [Mon, 9 Nov 2020 14:13:33 +0000 (15:13 +0100)]
Add integration test for symfony preloading

To help catch regressions like the one that occurred in PHP 7.4.12.

Closes GH-6414.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Tue, 10 Nov 2020 10:11:34 +0000 (11:11 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  7.3.26 is next

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Tue, 10 Nov 2020 10:11:06 +0000 (11:11 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  7.3.26 is next

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 10 Nov 2020 10:09:40 +0000 (11:09 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  7.3.26 is next

4 years ago7.3.26 is next
Christoph M. Becker [Tue, 10 Nov 2020 10:08:16 +0000 (11:08 +0100)]
7.3.26 is next

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 16:08:46 +0000 (17:08 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix phi use chain management when renaming variable

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 9 Nov 2020 16:08:38 +0000 (17:08 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix phi use chain management when renaming variable

4 years agoFix phi use chain management when renaming variable
Nikita Popov [Mon, 9 Nov 2020 16:06:41 +0000 (17:06 +0100)]
Fix phi use chain management when renaming variable

If there is a previous use of the new variable in the phi, we need
to NULL out the use chain of the new source we're adding.

Test case is reduced from an assertion failure in the Symfony Demo.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 13:44:46 +0000 (14:44 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Use true/false instead of TRUE/FALSE in intl

4 years agoUse true/false instead of TRUE/FALSE in intl
Nikita Popov [Mon, 9 Nov 2020 13:44:11 +0000 (14:44 +0100)]
Use true/false instead of TRUE/FALSE in intl

And drop the U_DEFINE_TRUE_AND_FALSE flag.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 13:35:48 +0000 (14:35 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80310: Support for icu4c 68.1.

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Mon, 9 Nov 2020 13:35:40 +0000 (14:35 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80310: Support for icu4c 68.1.

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Mon, 9 Nov 2020 13:34:24 +0000 (14:34 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #80310: Support for icu4c 68.1.

4 years agoFixed bug #80310: Support for icu4c 68.1.
Alexander M. Turek [Tue, 3 Nov 2020 18:14:41 +0000 (19:14 +0100)]
Fixed bug #80310: Support for icu4c 68.1.

On stable versions, bring back the TRUE/FALSE defines by defining
_U_DEFINE_TRUE_AND_FALSE.

Closes GH-6397.

4 years agoRemove mbstring identify filters
Alex Dowad [Wed, 4 Nov 2020 18:10:14 +0000 (20:10 +0200)]
Remove mbstring identify filters

mbstring had an 'identify filter' for almost every supported text encoding
which was used when auto-detecting the most likely encoding for a string.
It would run over the string and set a 'flag' if it saw anything which
did not appear likely to be the encoding in question.

One problem with this scheme was that encodings which merely appeared
less likely to be the correct one were completely rejected, even if there
was no better candidate. Another problem was that the 'identify filters'
had a huge amount of code duplication with the 'conversion filters'.

Eliminate the identify filters. Instead, when auto-detecting text
encoding, use conversion filters to see whether the input string is valid
in candidate encodings or not. At the same type, watch the type of
codepoints which the string decodes to and mark it as less likely if
non-printable characters (ESC, form feed, bell, etc.) or 'private use
area' codepoints are seen.

Interestingly, one old test case in which JIS text was misidentified
as UTF-8 (and this wrong behavior was enshrined in the test) was 'fixed'
and the JIS string is now auto-detected as JIS.

4 years agoTreat non-ASCII characters as erroneous when converting ASCII text
Alex Dowad [Thu, 5 Nov 2020 21:27:07 +0000 (23:27 +0200)]
Treat non-ASCII characters as erroneous when converting ASCII text

4 years agoFix mbstring support for EUC-JP text encoding
Alex Dowad [Thu, 1 Oct 2020 17:56:42 +0000 (19:56 +0200)]
Fix mbstring support for EUC-JP text encoding

- Don't allow control characters to appear in the middle of a multi-byte
  character. (A strange feature, or perhaps misfeature, of mbstring which is
  not present in other libraries such as iconv.)
- When checking whether string is valid, reject kuten codes which do not
  map to any character, whether converting from EUC-JP to another encoding,
  or converting another encoding which uses JIS X 0208/0212 charsets to
  EUC-JP.
- Truncated multi-byte characters are treated as an error.

4 years agoFix mbstring support for Shift-JIS
Alex Dowad [Mon, 19 Oct 2020 18:57:58 +0000 (20:57 +0200)]
Fix mbstring support for Shift-JIS

- Reject otherwise valid kuten codes which don't map to anything in JIS X 0208.
- Handle truncated multi-byte characters as an error.
- Convert Shift-JIS 0x7E to Unicode 0x203E (overline) as recommended by the
  Unicode Consortium, and as iconv does.
- Convert Shift-JIS 0x5C to Unicode 0xA5 (yen sign) as recommended by the
  Unicode Consortium, and as iconv does.
  (NOTE: This will affect PHP scripts which use an internal encoding of
  Shift-JIS! PHP assigns a special meaning to 0x5C, the backslash. For example,
  it is used for escapes in double-quoted strings. Mapping the Shift-JIS yen
  sign to the Unicode yen sign means the yen sign will not be usable for
  C escapes in double-quoted strings. Japanese PHP programmers who want to
  write their source code in Shift-JIS for some strange reason will have to
  use the JIS X 0208 backlash or 'REVERSE SOLIDUS' character for their C
  escapes.)
- Convert Unicode 0x5C (backslash) to Shift-JIS 0x815F (reverse solidus).
- Immediately handle error if first Shift-JIS byte is over 0xEF, rather than
  waiting to see the next byte. (Previously, the value used was 0xFC, which is
  the limit for the 2nd byte and not the 1st byte of a multi-byte character.)
- Don't allow 'control characters' to appear in the middle of a multi-byte
  character.

The test case for bug 47399 is now obsolete. That test assumed that a number
of Shift-JIS byte sequences which don't map to any character were 'valid'
(because the byte values were within the legal ranges).

4 years agoRemove useless byte{2,4}{be,le} encodings from mbstring
Alex Dowad [Wed, 4 Nov 2020 17:54:02 +0000 (19:54 +0200)]
Remove useless byte{2,4}{be,le} encodings from mbstring

There is no meaningful difference between these and UCS-{2,4}. They are
just a little bit more lax about passing errors silently. They also have
no known use.

Alias to UCS-{2,4} in case someone, somewhere is using them.

4 years agoFix issues with mbstring encoding tests
Alex Dowad [Thu, 5 Nov 2020 10:56:34 +0000 (12:56 +0200)]
Fix issues with mbstring encoding tests

I made some mistakes on this code, which meant that not everything which
should be tested was actually being tested.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 10:03:14 +0000 (11:03 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Remove embedded property from mysqli_driver

4 years agoRemove embedded property from mysqli_driver
Dharman [Fri, 6 Nov 2020 23:00:33 +0000 (23:00 +0000)]
Remove embedded property from mysqli_driver

All other leftovers of this feature have been dropped in PHP 8,
so we should remove the property as well.

Closes GH-6407.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 09:19:40 +0000 (10:19 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80334

4 years agoFixed bug #80334
Nikita Popov [Mon, 9 Nov 2020 09:18:43 +0000 (10:18 +0100)]
Fixed bug #80334

If assert() was called with named args, add description as named
arg as well.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 9 Nov 2020 08:50:51 +0000 (11:50 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed missaligned access

4 years agoFixed missaligned access
Dmitry Stogov [Mon, 9 Nov 2020 08:50:26 +0000 (11:50 +0300)]
Fixed missaligned access

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 08:47:12 +0000 (09:47 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Skip preload test under asan

4 years agoSkip preload test under asan
Nikita Popov [Mon, 9 Nov 2020 08:46:48 +0000 (09:46 +0100)]
Skip preload test under asan

Just like the other preload tests with startup failures, this may
cause leaks.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 9 Nov 2020 08:41:23 +0000 (09:41 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Rename PhpToken::getAll() to PhpToken::tokenize()

4 years agoRename PhpToken::getAll() to PhpToken::tokenize()
Nikita Popov [Mon, 9 Nov 2020 08:40:31 +0000 (09:40 +0100)]
Rename PhpToken::getAll() to PhpToken::tokenize()

See https://externals.io/message/112189.
Fixes bug #80328.

4 years agoMerge branch 'PHP-8.0'
Derick Rethans [Sat, 7 Nov 2020 18:49:11 +0000 (18:49 +0000)]
Merge branch 'PHP-8.0'

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Derick Rethans [Sat, 7 Nov 2020 18:49:00 +0000 (18:49 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoUpdate version in 7.4 branch
Derick Rethans [Sat, 7 Nov 2020 18:48:13 +0000 (18:48 +0000)]
Update version in 7.4 branch

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Fri, 6 Nov 2020 16:45:29 +0000 (17:45 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Split tests for compatibility with ICU 68.1

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Fri, 6 Nov 2020 16:44:51 +0000 (17:44 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Split tests for compatibility with ICU 68.1

4 years agoSplit tests for compatibility with ICU 68.1
Christoph M. Becker [Fri, 6 Nov 2020 16:11:26 +0000 (17:11 +0100)]
Split tests for compatibility with ICU 68.1

4 years agoStabalize IMAP parallel testing, again
George Peter Banyard [Fri, 6 Nov 2020 14:24:41 +0000 (14:24 +0000)]
Stabalize IMAP parallel testing, again

Drive by clean-up
Use less the default mailbox again

4 years agoMerge branch 'PHP-8.0'
Remi Collet [Fri, 6 Nov 2020 10:00:56 +0000 (11:00 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Raise E_WARNING on PHP related errors

4 years agoRaise E_WARNING on PHP related errors
Christoph M. Becker [Tue, 20 Oct 2020 10:31:58 +0000 (12:31 +0200)]
Raise E_WARNING on PHP related errors

If Zip operations fails due to PHP error conditions before libzip even
has been called, there is no meaningful indication what failed; the
functions just return false, and the Zip status indicated that no error
did occur.  Therefore we raise `E_WARNING` in these cases.

Closes GH-6356.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Fri, 6 Nov 2020 09:10:28 +0000 (12:10 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Move stack overflow checks out of the loops

4 years agoMove stack overflow checks out of the loops
Dmitry Stogov [Fri, 6 Nov 2020 09:09:56 +0000 (12:09 +0300)]
Move stack overflow checks out of the loops

4 years agoMerge branch 'PHP-8.0'
Remi Collet [Fri, 6 Nov 2020 08:59:47 +0000 (09:59 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  report about ZSTD compression availability
  only display libzip both headers/library versions if they differ

4 years agoreport about ZSTD compression availability
Remi Collet [Thu, 5 Nov 2020 16:18:22 +0000 (17:18 +0100)]
report about ZSTD compression availability

4 years agoonly display libzip both headers/library versions if they differ
Remi Collet [Thu, 5 Nov 2020 16:13:39 +0000 (17:13 +0100)]
only display libzip both headers/library versions if they differ

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 5 Nov 2020 15:38:02 +0000 (16:38 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Backport preloading trait fixup fixes

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 5 Nov 2020 15:37:45 +0000 (16:37 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Backport preloading trait fixup fixes

4 years agoBackport preloading trait fixup fixes
Nikita Popov [Thu, 5 Nov 2020 10:58:31 +0000 (11:58 +0100)]
Backport preloading trait fixup fixes

This cherry-picks 33969c2252b2c33a72c9039072af8862fd347a5f and
2effbfd8713936742ef46e6e85ce193b320ac005 from PHP-8.0.

The issues these commits fix could also manifest in PHP 7.4, and
a commenter on bug #80307 reports this this might indeed be
happening.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Thu, 5 Nov 2020 15:32:46 +0000 (18:32 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed incorrect invariant guard motion

4 years agoFixed incorrect invariant guard motion
Dmitry Stogov [Thu, 5 Nov 2020 15:32:00 +0000 (18:32 +0300)]
Fixed incorrect invariant guard motion

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 5 Nov 2020 12:16:31 +0000 (13:16 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixup trait methods even if no traits are used

4 years agoFixup trait methods even if no traits are used
Nikita Popov [Thu, 5 Nov 2020 12:15:32 +0000 (13:15 +0100)]
Fixup trait methods even if no traits are used

Trait methods might be non-trivially inherited, in which case we
may have to perform fixup in classes that do not directly use any
traits.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Thu, 5 Nov 2020 11:11:20 +0000 (12:11 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix multiple trait fixup

4 years agoFix multiple trait fixup
Nikita Popov [Thu, 5 Nov 2020 10:58:31 +0000 (11:58 +0100)]
Fix multiple trait fixup

If a trait method is inherited, preloading trait fixup might be
performed on it multiple times. Usually this is fine, because
the opcodes pointer will have already been updated, and will thus
not be found in the xlat table.

However, it can happen that the new opcodes pointer is the same
as one of the old opcodes pointers, if the pointer has been reused
by the allocator. In this case we will look up the wrong op array
and overwrite the trait method with an unrelated trait method.

We fix this by indexing the xlat table not by the opcodes pointer,
but by the refcount pointer. The refcount pointer is not changed
during optimization, and accurately represents which op arrays
should use the same opcodes.

Fixes bug #80307. The test case does not reproduce the bug, because
this depends on a lot of "luck" with the allocator. The test case
merely illustrates a case where orig_op_array would have been NULL
in the original code.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 15:05:48 +0000 (16:05 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  End output handlers in preload shutdown

4 years agoEnd output handlers in preload shutdown
Nikita Popov [Wed, 4 Nov 2020 15:03:39 +0000 (16:03 +0100)]
End output handlers in preload shutdown

Same as in php_request_shutdown(), we need to end any active
output handlers, as these may no longer be safe to execute
lateron.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 14:53:17 +0000 (15:53 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  getlastmod() can return false

4 years agogetlastmod() can return false
Nikita Popov [Wed, 4 Nov 2020 14:49:12 +0000 (15:49 +0100)]
getlastmod() can return false

At least this can happen during preloading.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 14:43:00 +0000 (15:43 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix static variable in methods inheritance during preloading

4 years agoFix static variable in methods inheritance during preloading
Nikita Popov [Wed, 4 Nov 2020 14:33:11 +0000 (15:33 +0100)]
Fix static variable in methods inheritance during preloading

This is now "bug compatible" with the normal behavior, and more
imporantly, does not crash :)

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Wed, 4 Nov 2020 13:58:47 +0000 (14:58 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #80266: parse_url silently drops port number 0

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Wed, 4 Nov 2020 13:56:54 +0000 (14:56 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #80266: parse_url silently drops port number 0

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Wed, 4 Nov 2020 13:54:14 +0000 (14:54 +0100)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #80266: parse_url silently drops port number 0

4 years agoFix #80266: parse_url silently drops port number 0
Christoph M. Becker [Wed, 4 Nov 2020 10:34:10 +0000 (11:34 +0100)]
Fix #80266: parse_url silently drops port number 0

As of commit 81b2f3e[1], `parse_url()` accepts URLs with a zero port,
but does not report that port, what is wrong in hindsight.

Since the port number is stored as `unsigned short` there is no way to
distinguish between port zero and no port.  For BC reasons, we thus
introduce `parse_url_ex2()` which accepts an output parameter that
allows that distinction, and use the new function to fix the behavior.

The introduction of `parse_url_ex2()` has been suggested by Nikita.

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

Closes GH-6399.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 13:52:47 +0000 (14:52 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Assert that references are not persisted

4 years agoAssert that references are not persisted
Nikita Popov [Wed, 4 Nov 2020 13:51:44 +0000 (14:51 +0100)]
Assert that references are not persisted

There should not be any need to persist references, and it's unlikely
that persisting a reference will behave correctly at runtime, because
we don't have a concept of an immutable reference.

4 years agoFix parallel testing for IMAP
George Peter Banyard [Wed, 4 Nov 2020 12:40:12 +0000 (12:40 +0000)]
Fix parallel testing for IMAP

The script for the clean section was missing the $ Meta-character to only delete the default
mailbox when it's an exact match.

Reinstore parallel testing for more tests.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 11:31:28 +0000 (12:31 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't xfail method_static_var.phpt

4 years agoDon't xfail method_static_var.phpt
Nikita Popov [Wed, 4 Nov 2020 11:30:41 +0000 (12:30 +0100)]
Don't xfail method_static_var.phpt

Let's test the current behavior here. It might not be right, but
it's long-standing behavior.

Nearly missed an assertion failure here because the test was
XFAILed...

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 4 Nov 2020 10:12:22 +0000 (11:12 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't disable opcache for generic tests