]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 27 Nov 2020 13:49:57 +0000 (14:49 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix AVX detection

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Fri, 27 Nov 2020 13:49:45 +0000 (14:49 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix AVX detection

4 years agoFix AVX detection
Nikita Popov [Fri, 27 Nov 2020 10:54:39 +0000 (11:54 +0100)]
Fix AVX detection

Our CPU detection code currently only checks whether hardware
support for AVX exists. However, we also need to check for operating
system support for XSAVE, as well as whether XCR0 has the SSE and
AVX bits set.

If this is not the case, unset the AVX and AVX2 bits in the cpuinfo
structure.

Hopefully this resolves our issues with CPU support detection.

Closes GH-6460.

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

* PHP-8.0:
  Only use travis for cron jobs

4 years agoOnly use travis for cron jobs
Nikita Popov [Fri, 27 Nov 2020 13:15:34 +0000 (14:15 +0100)]
Only use travis for cron jobs

Our primary CI has been Azure Pipelines for a while now already.
Travis was primarily retained as a) a fast feedback builder and
b) to test architectures not available elsewhere.

Due to Travis CI open source policy changes, Travis is no longer
useful as a fast feedback builder. As such, only use it for cron
job builds.

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

* PHP-8.0:
  Make sure zend_cpu_supports_pclmul() is always defined

4 years agoMake sure zend_cpu_supports_pclmul() is always defined
Nikita Popov [Fri, 27 Nov 2020 11:22:03 +0000 (12:22 +0100)]
Make sure zend_cpu_supports_pclmul() is always defined

If __builtin_cpu_supports() is available, but doesn't have support
for pclmul, the function would end up not being defined at all.

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

* PHP-8.0:
  Fix mysqli_get_client_stats test

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

* PHP-7.4:
  Fix mysqli_get_client_stats test

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

* PHP-7.3:
  Fix mysqli_get_client_stats test

4 years agoFix mysqli_get_client_stats test
Daniel Black [Fri, 27 Nov 2020 05:43:20 +0000 (16:43 +1100)]
Fix mysqli_get_client_stats test

MySQL removed RENAME DATABASE in 18300001c1dbbfddf9a0adcbaeea68956102bdd0
(Sept 2007, 5.1.23). As this briefest existance is very insignificant lets remove it.

It also breaks when testing against MariaDB.

As the alternate path in this test covers all supported MySQL and MariaDB
versions and a signifant portion of unsupported versions lets keep it simple.

Closes GH-6459.

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

* PHP-8.0:
  Avoid direct calls to zend_cpu_supports()
  Assert that cpuinfo is initialized before use
  Move avx check into a macro

4 years agoAvoid direct calls to zend_cpu_supports()
Nikita Popov [Fri, 27 Nov 2020 10:18:10 +0000 (11:18 +0100)]
Avoid direct calls to zend_cpu_supports()

While the use of zend_cpu_supports_*() is only strictly necessary
inside ifunc resolvers, where the cpu state has not been initialized
yet, we should prefer the compiler builtins in all cases.

4 years agoAssert that cpuinfo is initialized before use
Nikita Popov [Fri, 27 Nov 2020 10:14:07 +0000 (11:14 +0100)]
Assert that cpuinfo is initialized before use

And fix some incorrect indentation.

4 years agoMove avx check into a macro
Nikita Popov [Fri, 27 Nov 2020 10:06:05 +0000 (11:06 +0100)]
Move avx check into a macro

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

* PHP-8.0:
  Fixed bug #80368

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Fri, 27 Nov 2020 09:58:04 +0000 (10:58 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80368

4 years agoFixed bug #80368
Nikita Popov [Fri, 27 Nov 2020 09:57:19 +0000 (10:57 +0100)]
Fixed bug #80368

We assume that usually LibreSSL supports everything OpenSSL 1.1 does.
In this instance, this is not the case.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 27 Nov 2020 09:52:21 +0000 (10:52 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80433

4 years agoFixed bug #80433
Nikita Popov [Fri, 27 Nov 2020 09:51:57 +0000 (10:51 +0100)]
Fixed bug #80433

Use ZEND_STRTOL to allow leading zeros in opcache.jit option.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 27 Nov 2020 09:03:28 +0000 (10:03 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80425

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Fri, 27 Nov 2020 09:03:02 +0000 (10:03 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80425

4 years agoFixed bug #80425
Nikita Popov [Fri, 27 Nov 2020 09:02:00 +0000 (10:02 +0100)]
Fixed bug #80425

Rename the methods in MessageFormatAdapter to make sure they don't
clash with anything defined by icu itself, which may be a problem
if icu is linked statically.

4 years agoMerge branch 'PHP-8.0' into master
Christopher Jones [Thu, 26 Nov 2020 23:17:54 +0000 (10:17 +1100)]
Merge branch 'PHP-8.0' into master

* PHP-8.0:
  Update PECL package release date

4 years agoUpdate PECL package release date
Christopher Jones [Thu, 26 Nov 2020 23:17:37 +0000 (10:17 +1100)]
Update PECL package release date

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Thu, 26 Nov 2020 22:41:09 +0000 (23:41 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix bug number

4 years agoFix bug number
Christoph M. Becker [Thu, 26 Nov 2020 22:34:35 +0000 (23:34 +0100)]
Fix bug number

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Thu, 26 Nov 2020 18:05:29 +0000 (21:05 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Eliminate dead stores

4 years agoEliminate deafd stores
Dmitry Stogov [Thu, 26 Nov 2020 18:05:07 +0000 (21:05 +0300)]
Eliminate deafd stores

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

* PHP-8.0:
  Fix bug #80402: Don't strip -lpthread

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Thu, 26 Nov 2020 10:56:00 +0000 (11:56 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix bug #80402: Don't strip -lpthread

4 years agoFix bug #80402: Don't strip -lpthread
Nikita Popov [Tue, 24 Nov 2020 11:23:03 +0000 (12:23 +0100)]
Fix bug #80402: Don't strip -lpthread

The current behavior has been introduced 20 years ago in
f9e375f493a1aeacbbcc8f2f00880d05b4ba7aaf as part of a larger change.
It's not clear to me why special treatement of -lpthread is necessary
here.

4 years agoMerge branch 'PHP-8.0'
Sara Golemon [Thu, 26 Nov 2020 02:20:37 +0000 (02:20 +0000)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Remove -dev from ZEND_VERSION

4 years agoRemove -dev from ZEND_VERSION
Sara Golemon [Thu, 26 Nov 2020 02:19:12 +0000 (02:19 +0000)]
Remove -dev from ZEND_VERSION

4 years agoConvert U+00AF (MACRON) to 0x8150 (FULLWIDTH MACRON) in some SJIS variants
Alex Dowad [Sat, 14 Nov 2020 21:43:28 +0000 (23:43 +0200)]
Convert U+00AF (MACRON) to 0x8150 (FULLWIDTH MACRON) in some SJIS variants

Except for vanilla Shift-JIS, where 0x7E is a halfwidth overline/macron.
As for Shift-JIS-2004, it has an added character (byte sequence 0x854A)
which was defined as a halfwidth macron in JIS X 0213:2000, so we use that.

4 years agoConvert U+FF5E (FULLWIDTH TILDE) to 0x8160 (WAVE DASH) in SJIS variants
Alex Dowad [Sat, 14 Nov 2020 21:07:17 +0000 (23:07 +0200)]
Convert U+FF5E (FULLWIDTH TILDE) to 0x8160 (WAVE DASH) in SJIS variants

By entering this character in the JIS X 0208 conversion table, we can
remove a bunch of explicit `if` clauses in different conversion filters.
It also means that U+FF5E can be converted into SJIS-mac now; I don't
know why this one SJIS variant rejected U+FF5E before, since 0x8160
means the same thing in SJIS-mac as the others.

4 years agoConvert U+203E (OVERLINE) to 0x8150 (FULLWIDTH MACRON) in some SJIS variants
Alex Dowad [Sat, 14 Nov 2020 21:03:03 +0000 (23:03 +0200)]
Convert U+203E (OVERLINE) to 0x8150 (FULLWIDTH MACRON) in some SJIS variants

Converting U+203E to 0x7E was especially wrong for CP932, where 0x7E
represents a tilde.

For vanilla Shift-JIS and Shift-JIS-2004, converting to 0x7E is acceptable,
since 0x7E does represent an overline/macron in those encodings.

Follow the same principle in CP51932, which is closely related to CP932.

4 years ago0x7E is not a tilde in Shift-JIS{,-2004}
Alex Dowad [Sat, 14 Nov 2020 19:51:23 +0000 (21:51 +0200)]
0x7E is not a tilde in Shift-JIS{,-2004}

4 years ago0x5C is not a Yen sign in CP932 (or CP51932)
Alex Dowad [Sat, 14 Nov 2020 19:15:11 +0000 (21:15 +0200)]
0x5C is not a Yen sign in CP932 (or CP51932)

When Microsoft created CP932 (their version of Shift-JIS), they explicitly
used bytes 0-0x7F to represent ASCII characters rather than JIS X 0201
characters.

So when converting Unicode to CP932, it is not correct to convert U+00A5
to CP932 0x5C. Fortunately, CP932 does have a multi-byte FULLWIDTH YEN SIGN
character which we can use instead.

CP51932 uses the same extended character set as CP932; while CP932 is
MicroSoft's extended version of Shift-JIS, CP51932 is their extended version
of EUC-JP. So the same reasoning applies to CP51932.

4 years ago0x5C is not a backslash in Shift-JIS-2004
Alex Dowad [Sat, 14 Nov 2020 18:47:31 +0000 (20:47 +0200)]
0x5C is not a backslash in Shift-JIS-2004

Shift-JIS-2004 is an extension of Shift-JIS, which uses 0x5C for the Yen
sign. Therefore, it is not correct to convert ASCII 0x5C (backslash) to
Shift-JIS-2004 0x5C (yen sign). JIS X 0208 does have a backslash, so we
can convert ASCII backslash to SJIS-2004 backslash instead.

From time immemorial, there has been confusion around the treatment
of 0x5C bytes on systems using legacy Japanese encodings. JIS X 0201
specified that 0x5C means a yen sign, and thus fonts on Japanese systems,
including early versions of Windows, displayed a 0x5C byte as a yen sign.
This meant that when ASCII text files were displayed on such systems,
what were meant to be backslashes would appear as yen signs. Japanese C
programmers could write character escapes using yen signs, and C compilers
built on the assumption that the input was ASCII would interpret these
escapes as desired. Likewise for shell scripts. Et cetera, et cetera...

Therefore, if the input to `mb_convert_encoding` is (for example) a C
program, and after converting to Shift-JIS-2004, the user wishes to feed
the output into a C compiler, *then* perhaps ASCII 0x5C should be mapped
to SJIS 0x5C. However, this scenario is ridiculous and will never happen.

A more realistic scenario might be: an article written in SJIS-2004 has
embedded Windows file paths (like 'C:\Program Files'), with yen signs used
as a path separator. If we convert SJIS-2004 0x5C to ASCII 0x5C, then the
path separators will be 'fixed' by the conversion.

For general written texts, it is much better to convert backslashes to...
backslashes. And yen signs, to yen signs.

4 years agoEnhance handling of CP51932 encoding
Alex Dowad [Sun, 18 Oct 2020 12:27:21 +0000 (14:27 +0200)]
Enhance handling of CP51932 encoding

- Don't pass 'control' characters through in the middle of a multi-byte char
- Treat truncated multi-byte characters as an error

4 years agoFix mbstring support for SJIS-Mobile (DoCoMo, KDDI, and Softbank variants of Shift...
Alex Dowad [Tue, 20 Oct 2020 05:47:20 +0000 (07:47 +0200)]
Fix mbstring support for SJIS-Mobile (DoCoMo, KDDI, and Softbank variants of Shift-JIS)

Lots of problems here.

- Don't pass 'control' characters through silently in the middle of a
  multi-byte character.
- Treat it as an error if a multi-byte character is truncated.
- For ESC sequences used to encode emoji on earlier Softbank phones, if an
  invalid ESC sequence is found, don't pass it through. Rather, handle it as
  an error and respect `mb_substitute_character`.
- In ranges used by mobile vendors for emoji, if a certain byte sequence
  doesn't map to any emoji, don't emit a mangled value (actually a raw
  (ku*94)+ten value, which may not even be a valid Unicode codepoint at all).
- When converting Unicode to SJIS-Mobile, don't mangle codepoints which fall
  in the 2nd range of MicroSoft vendor extensions.

Some vendor-specific emoji have been mapped to standard Unicode codepoints
now, rather than 'private use area' codepoints. When the legacy code was
written, these codepoints may not have existed yet in the Unicode standard
which was current at that time.

Also do a major code cleanup -- remove dead code, rearrange what is left,
use some new macros and helper functions to make the code clearer...

4 years agoCombine MBFL_ENCTYPE_MWC2{BE,LE} constants
Alex Dowad [Tue, 13 Oct 2020 05:58:53 +0000 (07:58 +0200)]
Combine MBFL_ENCTYPE_MWC2{BE,LE} constants

These constants indicate that a text encoding uses 2+ bytes for each character,
and is either big endian or little endian (respectively). But nothing in
mbstring cares about the difference between MBFL_ENCTYPE_MWC2BE and
MBFL_ENCTYPE_MWC2LE.

(Actually, nothing cares about whether these flags are set at all...
maybe we should just remove them?)

4 years agoCombine MBFL_ENCTYPE_WCS{2,4}{BE,LE} constants
Alex Dowad [Sun, 20 Sep 2020 14:29:32 +0000 (16:29 +0200)]
Combine MBFL_ENCTYPE_WCS{2,4}{BE,LE} constants

These flags identify text encodings in mbstring which use a constant number of
bytes per character. While some parts of the code do use these flags, usually
to detect cases which can be optimized due to constant-width encoding, nothing
cares whether the encodings are 'LE' (little-endian) or 'BE' (big-endian).

So we can simplify things by combining constants.

4 years agoDon't pass invalid JIS X 0212, JIS X 0213, and Windows-CP932 characters through
Alex Dowad [Wed, 7 Oct 2020 20:30:34 +0000 (22:30 +0200)]
Don't pass invalid JIS X 0212, JIS X 0213, and Windows-CP932 characters through

Similarly to JIS X 0208, mbstring would pass kuten codes which are not mapped
in the JIS X 0212, JIS X 0213, or CP932 character sets through silently when
converting to another Japanese encoding.

4 years agoDon't pass invalid JIS X 0208 characters through
Alex Dowad [Wed, 7 Oct 2020 20:12:27 +0000 (22:12 +0200)]
Don't pass invalid JIS X 0208 characters through

Many Japanese encodings, such as JIS7/8, Shift JIS, ISO-2022-JP, EUC-JP, and
so on encode characters from the JIS X 0208 character set. JIS X 0208 is based
on the concept of a 94x94 table, with numbered rows and columns. However,
more than a thousand of the cells in that table are empty; JIS X 0208 does not
actually use all 94x94=8,836 possible kuten codes.

mbstring had a dubious feature whereby, if a Japanese string contained one of
these 'unmapped' kuten codes, and it was being converted to another Japanese
encoding which was also based on JIS X 0208, the non-existent character would
be silently passed through, and the unmapped kuten code would be re-encoded
using the normal encoding method of the target text encoding.

Again, this _only_ happened if converting the text with the funky kuten code
to a Japanese encoding. If one tried converting it to Unicode, mbstring would
treat that as an error.

If somebody, somewhere, made their own private extension to JIS X 0208, and
used the regular Japanese encodings like Shift JIS and EUC-JP to encode this
private character set, then this feature might conceivably be useful. But how
likely is that? If someone is using Shift JIS, EUC-JP, ISO-2022-JP, etc. to
encode a funky version of JIS X 0208 with extra characters added, then that
should be treated as a separate text encoding.

The code which flags such characters with MBFL_WCSPLANE_JIS0208 is retained
solely for error reporting in `mbfl_filt_conv_illegal_output`.

4 years agoEnhance handling of CP932 text encoding
Alex Dowad [Sun, 4 Oct 2020 20:29:34 +0000 (22:29 +0200)]
Enhance handling of CP932 text encoding

- Don't allow control characters to appear in the middle of a multi-byte
  character. (This was a strange feature of mbstring; it doesn't make much
  sense, and iconv doesn't allow it.)
- Treat truncated multi-byte characters as an error.

4 years agoBugfixes for findInvalidChars (helper for mbstring test suite)
Alex Dowad [Mon, 16 Nov 2020 19:16:24 +0000 (21:16 +0200)]
Bugfixes for findInvalidChars (helper for mbstring test suite)

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Wed, 25 Nov 2020 16:28:38 +0000 (17:28 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Add UPGRADING note for PDO::inTransaction()

[ci skip]

4 years agoAdd UPGRADING note for PDO::inTransaction()
Nikita Popov [Wed, 25 Nov 2020 16:28:23 +0000 (17:28 +0100)]
Add UPGRADING note for PDO::inTransaction()

[ci skip]

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

* PHP-8.0:
  Fixed bug #80411

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 25 Nov 2020 16:24:49 +0000 (17:24 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80411

4 years agoFixed bug #80411
Nikita Popov [Wed, 25 Nov 2020 16:23:42 +0000 (17:23 +0100)]
Fixed bug #80411

References to null-serializations are stored as null, and as such
are part of the reference count.

Reminds me that we really need to deprecate the mess that is
Serializable.

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

* PHP-8.0:
  Fix unserialization ref source management, again

4 years agoFix unserialization ref source management, again
Nikita Popov [Wed, 25 Nov 2020 16:04:07 +0000 (17:04 +0100)]
Fix unserialization ref source management, again

Handle one case the previous patch did not account for: If
unserialization of data fails, we should still register a ref
source.

Also add an extra test for a reference between two typed properties,
as this used to be handled incorrectly earlier.

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

* PHP-8.0:
  Fixed error reporting in mysqli_stmt::__construct

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 25 Nov 2020 15:29:00 +0000 (16:29 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed error reporting in mysqli_stmt::__construct

4 years agoFixed error reporting in mysqli_stmt::__construct
Dharman [Tue, 24 Nov 2020 23:02:04 +0000 (23:02 +0000)]
Fixed error reporting in mysqli_stmt::__construct

For the sake of simplicity, I've synchronized the implementation
with PHP 8, which means null values are also accepted.

Closes GH-6454.

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

* PHP-8.0:
  Fix phpt reindentation in tidy script
  Reindent more mysqli tests

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 25 Nov 2020 15:08:28 +0000 (16:08 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Reindent more mysqli tests

4 years agoFix phpt reindentation in tidy script
Nikita Popov [Wed, 25 Nov 2020 15:07:56 +0000 (16:07 +0100)]
Fix phpt reindentation in tidy script

This was missing adjacent SKIPIF/FILE/CLEAN sections.

4 years agoReindent more mysqli tests
Nikita Popov [Wed, 25 Nov 2020 15:07:16 +0000 (16:07 +0100)]
Reindent more mysqli tests

Due to a bug in the tidy script, most tests did not actually get
reindented...

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

* PHP-8.0:
  Reindent ext/mysqli tests
  Allow running tidy.php on specific directory

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Wed, 25 Nov 2020 14:58:21 +0000 (15:58 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Reindent ext/mysqli tests

4 years agoReindent ext/mysqli tests
Nikita Popov [Wed, 25 Nov 2020 14:57:11 +0000 (15:57 +0100)]
Reindent ext/mysqli tests

Reindent ext/mysqli tests on PHP-7.4, so they match with the
indentation on PHP-8.0. Otherwise merging test changes across
branches is very unpleasant.

4 years agoAllow running tidy.php on specific directory
Nikita Popov [Wed, 25 Nov 2020 14:54:26 +0000 (15:54 +0100)]
Allow running tidy.php on specific directory

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

* PHP-8.0:
  Fix ref source management during unserialization

4 years agoFix ref source management during unserialization
Nikita Popov [Wed, 25 Nov 2020 11:25:07 +0000 (12:25 +0100)]
Fix ref source management during unserialization

Only register the slot for adding ref sources later if we didn't
immediately register one. Also avoids leaking a ref source if
it is added early and the assignment fails.

Fixes oss-fuzz #27628.

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

* PHP-8.0:
  sockets: Fix variable/macro name collision on AIX

4 years agosockets: Fix variable/macro name collision on AIX
Calvin Buckley [Tue, 24 Nov 2020 19:45:34 +0000 (15:45 -0400)]
sockets: Fix variable/macro name collision on AIX

The name "rem_size" is used by a macro in a system header on AIX,
specifically `sys/xmem.h`. Without changing the name, you get the
name mangled like so:

```
In file included from /usr/include/sys/uio.h:92:0,
                 from /QOpenSys/pkgs/lib/gcc/powerpc-ibm-aix6.1.0.0/6.3.0/include-fixed-7.1/sys/socket.h:83,
                 from /usr/include/sys/syslog.h:151,
                 from /usr/include/syslog.h:29,
                 from /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/main/php_syslog.h:27,
                 from /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/main/php.h:318,
                 from /home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:17:
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c: In function 'zif_socket_cmsg_space':
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:298:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
   size_t rem_size = ZEND_LONG_MAX - entry->size;
          ^
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:298:10: error: expected expression before '.' token
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:299:18: error: 'u2' undeclared (first use in this function)
   size_t n_max = rem_size / entry->var_el_size;
                  ^
/home/calvin/rpmbuild/BUILD/php-8.0.0RC5/ext/sockets/sendrecvmsg.c:299:18: note: each undeclared identifier is reported only once for each function it appears in
```

...because of the declaration in `sys/xmem.h`:

```
```

This just renames the variable so that it won't trip on this
definition. Tested to fix the build on IBM i PASE.

Closes GH-6453.

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

* PHP-8.0:
  Fixed bug #80377

4 years agoFixed bug #80377
Nikita Popov [Tue, 24 Nov 2020 14:52:41 +0000 (15:52 +0100)]
Fixed bug #80377

Make sure the $PHP_THREAD_SAFETY variable is always available
when configuring extensions. It was previously available for
phpized extensions, but for in-tree builds it was being set
too late.

Then, use $PHP_THREAD_SAFETY instead of $enable_zts to check for
ZTS in bundled extensions, which makes sure these checks also
work for phpize builds.

4 years agoMerge branch 'PHP-8.0' into master
Christopher Jones [Wed, 25 Nov 2020 05:42:52 +0000 (16:42 +1100)]
Merge branch 'PHP-8.0' into master

* PHP-8.0:
  Fix test diff

4 years agoFix test diff
Christopher Jones [Wed, 25 Nov 2020 05:42:12 +0000 (16:42 +1100)]
Fix test diff

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Wed, 25 Nov 2020 00:50:55 +0000 (03:50 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Use diferent temporary register (%r0 may keep a method address)

4 years agoUse diferent temporary register (%r0 may keep a method address)
Dmitry Stogov [Wed, 25 Nov 2020 00:49:42 +0000 (03:49 +0300)]
Use diferent temporary register (%r0 may keep a method address)

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Tue, 24 Nov 2020 22:13:21 +0000 (01:13 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Revert "Fixed bug #80377"

4 years agoRevert "Fixed bug #80377"
Dmitry Stogov [Tue, 24 Nov 2020 22:10:26 +0000 (01:10 +0300)]
Revert "Fixed bug #80377"

This reverts commit fc26ad9b1220fdfd7db15ecaff5e7c38283c55b6.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Tue, 24 Nov 2020 17:19:07 +0000 (18:19 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  [ci skip] Fix misspelled method names

4 years ago[ci skip] Fix misspelled method names
Florian Engelhardt [Tue, 24 Nov 2020 15:48:17 +0000 (16:48 +0100)]
[ci skip] Fix misspelled method names

Closes GH-6452.

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

* PHP-8.0:
  Fix usage of casted string in ReflectionParameter ctor

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 24 Nov 2020 15:42:52 +0000 (16:42 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix usage of casted string in ReflectionParameter ctor

4 years agoFix usage of casted string in ReflectionParameter ctor
Nikita Popov [Tue, 24 Nov 2020 15:41:18 +0000 (16:41 +0100)]
Fix usage of casted string in ReflectionParameter ctor

Fixes oss-fuzz #27755.

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

* PHP-8.0:
  Fixed bug #80377

4 years agoFixed bug #80377
Nikita Popov [Tue, 24 Nov 2020 14:52:41 +0000 (15:52 +0100)]
Fixed bug #80377

Use $PHP_THREAD_SAFETY instead of $enable_zts to check for ZTS.
This variable is also available for phpize builds, while enable_zts
is only present for in-tree builds.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 24 Nov 2020 14:27:50 +0000 (15:27 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80393

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 24 Nov 2020 14:27:35 +0000 (15:27 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80393

4 years agoFixed bug #80393
Nikita Popov [Tue, 24 Nov 2020 14:26:40 +0000 (15:26 +0100)]
Fixed bug #80393

Handle macos versions that don't start with 10.* in libtool.

Patch by kir dot morozov at gmail dot com.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Tue, 24 Nov 2020 13:12:55 +0000 (14:12 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Allow PHP_CURL_APIs to be imported by DLLs

4 years agoAllow PHP_CURL_APIs to be imported by DLLs
Christoph M. Becker [Thu, 19 Nov 2020 14:42:01 +0000 (15:42 +0100)]
Allow PHP_CURL_APIs to be imported by DLLs

Closes GH-6438.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Tue, 24 Nov 2020 13:07:18 +0000 (14:07 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #77961: finfo_open crafted magic parsing SIGABRT

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

* PHP-7.4:
  Fix #77961: finfo_open crafted magic parsing SIGABRT

4 years agoFix #77961: finfo_open crafted magic parsing SIGABRT
Christoph M. Becker [Mon, 23 Nov 2020 16:12:46 +0000 (17:12 +0100)]
Fix #77961: finfo_open crafted magic parsing SIGABRT

libmagic may abort the running process, which is not desirable for PHP;
we raise a fatal error instead.

Closes GH-6437.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Tue, 24 Nov 2020 12:39:15 +0000 (13:39 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  [ci skip] Update generate_patch.sh

4 years ago[ci skip] Update generate_patch.sh
Christoph M. Becker [Tue, 24 Nov 2020 12:35:15 +0000 (13:35 +0100)]
[ci skip] Update generate_patch.sh

This has apparently been forgotten when updating to libmagic 5.39.

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

* PHP-8.0:
  Fix #80366: Return Value of zend_fstat() not Checked

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

* PHP-7.4:
  Fix #80366: Return Value of zend_fstat() not Checked

4 years agoFix #80366: Return Value of zend_fstat() not Checked
Christoph M. Becker [Tue, 17 Nov 2020 13:42:22 +0000 (14:42 +0100)]
Fix #80366: Return Value of zend_fstat() not Checked

In the somewhat unlikely case that `zend_fstat()` fails, we must not
proceed executing the function, but return `false` instead.

Patch based on the patch contributed by sagpant at microsoft dot com.

Closes GH-6432.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Tue, 24 Nov 2020 12:02:17 +0000 (13:02 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed bug #80362: Running dtrace scripts can cause php to crash

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Nikita Popov [Tue, 24 Nov 2020 12:02:08 +0000 (13:02 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80362: Running dtrace scripts can cause php to crash