]> granicus.if.org Git - php/log
php
4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Tue, 1 Dec 2020 06:59:25 +0000 (09:59 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Skip test if JIT is not available

4 years agoSkip test if JIT is not available
Dmitry Stogov [Tue, 1 Dec 2020 06:58:33 +0000 (09:58 +0300)]
Skip test if JIT is not available

4 years agohash: Add build dir for ext/hash/murmur
Anatol Belski [Mon, 30 Nov 2020 19:48:05 +0000 (20:48 +0100)]
hash: Add build dir for ext/hash/murmur

Signed-off-by: Anatol Belski <ab@php.net>
4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 30 Nov 2020 15:04:04 +0000 (16:04 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #62004: SplFileObject: fgets after seek returns wrong line

4 years agoFix #62004: SplFileObject: fgets after seek returns wrong line
Christoph M. Becker [Wed, 18 Nov 2020 12:41:21 +0000 (13:41 +0100)]
Fix #62004: SplFileObject: fgets after seek returns wrong line

As it is, `::seek(0)` sets the file pointer to the beginning of the
file, but `::seek($n)` where `$n > 0` sets the file pointer to the
beginning of the following line, having line `$n` already read into the
line buffer.  This is pretty inconsistent; we fix it by always seeking
to the beginning of the line.

We also add a test case for the duplicate bug #46569.

Closes GH-6434.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 30 Nov 2020 14:56:32 +0000 (17:56 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Preallocate stack space for JIT in execute_ex() to eliminate JIT prologue/epilogue.

4 years agoPreallocate stack space for JIT in execute_ex() to eliminate JIT prologue/epilogue.
Dmitry Stogov [Mon, 30 Nov 2020 14:56:08 +0000 (17:56 +0300)]
Preallocate stack space for JIT in execute_ex() to eliminate JIT prologue/epilogue.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 30 Nov 2020 14:47:02 +0000 (17:47 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fixed "may be used uninitialized" compilation warnings

4 years agoFixed "may be used uninitialized" compilation warnings
Dmitry Stogov [Mon, 30 Nov 2020 14:46:43 +0000 (17:46 +0300)]
Fixed "may be used uninitialized" compilation warnings

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 30 Nov 2020 14:24:44 +0000 (15:24 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Drop all JIT related XFAILS from phpdbg test suite

4 years agoDrop all JIT related XFAILS from phpdbg test suite
Christoph M. Becker [Mon, 30 Nov 2020 14:19:28 +0000 (15:19 +0100)]
Drop all JIT related XFAILS from phpdbg test suite

phpdbg now disables JIT, so these cause XFAIL warnings.

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

* PHP-8.0:
  Next attempt to fix bug #80368

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

* PHP-7.4:
  Next attempt to fix bug #80368

4 years agoNext attempt to fix bug #80368
Nikita Popov [Mon, 30 Nov 2020 14:15:59 +0000 (15:15 +0100)]
Next attempt to fix bug #80368

Apparently treating LibreSSL as OpenSSL 1.1 is not just something
we did in our code, it's something that upstream LibreSSL claims,
despite not actually being compatible. Duh.

Check for EVP_CIPH_OCB_MODE instead, which should reliably
determine support...

4 years agoMerge branch 'PHP-8.0'
George Peter Banyard [Mon, 30 Nov 2020 14:08:49 +0000 (14:08 +0000)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0
  Rename XmlParser to XMLParser for consistency with XMLWriter/XMLReader

4 years agoFix Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in...
George Peter Banyard [Mon, 30 Nov 2020 04:48:17 +0000 (04:48 +0000)]
Fix Bug #80438: imap_msgno() incorrectly warns and return false on valid UIDs in PHP 8.0.0

Checking for a valid Unique ID (UID) cannot use the convenience macro as they might
be larger than the message number which has for maximum value the total number of
current messages available in the mailbox.

4 years agoRename XmlParser to XMLParser for consistency with XMLWriter/XMLReader
George Peter Banyard [Tue, 24 Nov 2020 13:51:51 +0000 (13:51 +0000)]
Rename XmlParser to XMLParser for consistency with XMLWriter/XMLReader

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Mon, 30 Nov 2020 14:06:40 +0000 (15:06 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Suppress stream errors in mysqlnd

4 years agoSuppress stream errors in mysqlnd
Nikita Popov [Thu, 26 Nov 2020 11:30:17 +0000 (12:30 +0100)]
Suppress stream errors in mysqlnd

mysqlnd currently sets error_reporting=0 to suppress errors while
writing to streams. Unfortunately these errors are still visible
to userland error handlers, which is a source of confusion.
See for example https://bugs.php.net/bug.php?id=80412.

Instead add a stream flag that suppresses the emission of
read/write errors in the first place, and set it in mysqlnd.

I think it might be useful to have this option for userland as
well in the future, but for now this is just an internal
mechanism.

Closes GH-6458.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 30 Nov 2020 13:43:04 +0000 (16:43 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Hide phpdbg/JIT incompatibility macro (JIT is disabled for phpdbg)

4 years agoHide phpdbg/JIT incompatibility macro (JIT is disabled for phpdbg)
Dmitry Stogov [Mon, 30 Nov 2020 13:42:17 +0000 (16:42 +0300)]
Hide phpdbg/JIT incompatibility macro (JIT is disabled for phpdbg)

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

* PHP-8.0:
  Add additional entries to unserialize corpus

4 years agoAdd additional entries to unserialize corpus
Nikita Popov [Mon, 30 Nov 2020 13:32:07 +0000 (14:32 +0100)]
Add additional entries to unserialize corpus

These are useful to seed typed property fuzzing.

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

* PHP-8.0:
  Fix another ref source management bug in unserialize

4 years agoFix another ref source management bug in unserialize
Nikita Popov [Mon, 30 Nov 2020 13:23:17 +0000 (14:23 +0100)]
Fix another ref source management bug in unserialize

When we overwrite an existing property during unserialization,
we also have to drop the ref source from it.

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Mon, 30 Nov 2020 11:33:44 +0000 (12:33 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix #76813: Access violation near NULL on source operand

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Christoph M. Becker [Mon, 30 Nov 2020 11:32:45 +0000 (12:32 +0100)]
Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fix #76813: Access violation near NULL on source operand

4 years agoFix #76813: Access violation near NULL on source operand
Christoph M. Becker [Sat, 28 Nov 2020 12:47:37 +0000 (13:47 +0100)]
Fix #76813: Access violation near NULL on source operand

We avoid `YYCURSOR` becoming `NULL` by initializing `YYMARKER`, and add
a default rule for `<NORMAL>` where we catch unexpected input.

We also fix the only superficially related issue regarding empty input
followed by `T_SEPARATOR` and command, which caused another segfault.

Closes GH-6464.

4 years agoMerge branch 'PHP-8.0'
Dmitry Stogov [Mon, 30 Nov 2020 10:59:33 +0000 (13:59 +0300)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Disable JIT with incompatible third-party extensions

4 years agoDisable JIT with incompatible third-party extensions
Dmitry Stogov [Mon, 30 Nov 2020 10:58:34 +0000 (13:58 +0300)]
Disable JIT with incompatible third-party extensions

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

* PHP-8.0:
  Fixed bug #80437

4 years agoFixed bug #80437
Nikita Popov [Mon, 30 Nov 2020 10:40:46 +0000 (11:40 +0100)]
Fixed bug #80437

Only chmod if the file has been created.

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

* PHP-8.0:
  Only replace IN_ARRAY result type for JMPZ/JMPNZ

4 years agoOnly replace IN_ARRAY result type for JMPZ/JMPNZ
Nikita Popov [Mon, 30 Nov 2020 10:09:28 +0000 (11:09 +0100)]
Only replace IN_ARRAY result type for JMPZ/JMPNZ

Replacing the result type in the general case is dangerous,
because not all opcodes support both VAR and TMP. One common case
is the in_array() result being passed to SEND_VAR, which would
have to be changed to SEND_VAL.

Rather than complicating this logic, reduce the scope to only
doing the type replacement for JMPZ and JMPNZ. The only reason
we're doing this in the first place is to enable the smart branch
optimization, so we can limit it to the relevant opcodes. Replacing
the result type may be marginally useful in other cases as well
(as it may avoid reference checks), but not worth the bother.

4 years agophp_tidy_create_node() expects a fixed set of node_types
Christoph M. Becker [Sun, 29 Nov 2020 23:53:43 +0000 (00:53 +0100)]
php_tidy_create_node() expects a fixed set of node_types

This static function is not supposed to deal with arbitrary
`node_type`s, so there is no need to do so.

Closes GH-6467.

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

* PHP-8.0:
  Use ephemeral ports in mcast_ipv*_recv.phpt

4 years agoUse ephemeral ports in mcast_ipv*_recv.phpt
Nikita Popov [Mon, 30 Nov 2020 08:47:03 +0000 (09:47 +0100)]
Use ephemeral ports in mcast_ipv*_recv.phpt

4 years agoMerge branch 'PHP-8.0'
Christoph M. Becker [Sun, 29 Nov 2020 23:29:55 +0000 (00:29 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  tidy::repairFile() and ::repairString() return string|false

4 years agotidy::repairFile() and ::repairString() return string|false
Christoph M. Becker [Sun, 29 Nov 2020 23:24:15 +0000 (00:24 +0100)]
tidy::repairFile() and ::repairString() return string|false

4 years agoFix typos in comments
Christoph M. Becker [Sat, 28 Nov 2020 12:50:14 +0000 (13:50 +0100)]
Fix typos in comments

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

* PHP-8.0:
  Respect strict_types during sccp function call evaluation

4 years agoRespect strict_types during sccp function call evaluation
Nikita Popov [Fri, 27 Nov 2020 19:20:48 +0000 (20:20 +0100)]
Respect strict_types during sccp function call evaluation

Similar to what we do with attributes, add a dummy call frame
on which we can set the strict_types flag.

4 years agoRemove duplicate str_split check, fix test expectation
Tyson Andre [Fri, 27 Nov 2020 17:21:54 +0000 (12:21 -0500)]
Remove duplicate str_split check, fix test expectation

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 27 Nov 2020 16:50:48 +0000 (17:50 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Don't check for throwing calls in sccp function evaluation

4 years agoDon't check for throwing calls in sccp function evaluation
Nikita Popov [Fri, 27 Nov 2020 16:40:34 +0000 (17:40 +0100)]
Don't check for throwing calls in sccp function evaluation

We only need to reject functions that could warn (or have runtime
dependent behavior). If a function can throw in some cases, just
let it and discard the result.

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 27 Nov 2020 16:44:48 +0000 (17:44 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Fix handling of sccp exceptions

4 years agoFix handling of sccp exceptions
Nikita Popov [Fri, 27 Nov 2020 16:43:24 +0000 (17:43 +0100)]
Fix handling of sccp exceptions

We should clear the exception *before* we destroy the execute_data.
Add a variation of the test that indirects through another file,
and would crash otherwise.

4 years agoMerge branch 'PHP-8.0'
Jakub Zelenka [Fri, 27 Nov 2020 16:35:46 +0000 (16:35 +0000)]
Merge branch 'PHP-8.0'

4 years agoMerge branch 'PHP-7.4' into PHP-8.0
Jakub Zelenka [Fri, 27 Nov 2020 16:35:16 +0000 (16:35 +0000)]
Merge branch 'PHP-7.4' into PHP-8.0

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Jakub Zelenka [Fri, 27 Nov 2020 16:33:47 +0000 (16:33 +0000)]
Merge branch 'PHP-7.3' into PHP-7.4

4 years agoFix test for bug62890 to not depend on system cert store
Jakub Zelenka [Fri, 27 Nov 2020 16:32:43 +0000 (16:32 +0000)]
Fix test for bug62890 to not depend on system cert store

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

* PHP-8.0:
  Fix build for non-x86

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

* PHP-7.4:
  Fix build for non-x86

4 years agoFix build for non-x86
Nikita Popov [Fri, 27 Nov 2020 16:04:17 +0000 (17:04 +0100)]
Fix build for non-x86

4 years agoMerge branch 'PHP-8.0'
Nikita Popov [Fri, 27 Nov 2020 16:01:48 +0000 (17:01 +0100)]
Merge branch 'PHP-8.0'

* PHP-8.0:
  Handle exceptions during SCCP function evaluation

4 years agoHandle exceptions during SCCP function evaluation
Nikita Popov [Fri, 27 Nov 2020 16:00:12 +0000 (17:00 +0100)]
Handle exceptions during SCCP function evaluation

Easier to handle them than to ensure they can't happen in the
first place.

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.