Nikita Popov [Sat, 9 May 2020 09:53:39 +0000 (11:53 +0200)]
Fix bug68996.phpt test
The function name gets printed here now, with illegal chars
substituted in the arg. This slipped through previously, because
the test only runs under USE_ZEND_ALLOC=0. We remove that check
as well, because the test behaves the same regardless of which
allocator is used, even if the original bug only reproduces under
USE_ZEND_ALLOC=0.
Máté Kocsis [Sat, 29 Feb 2020 21:47:04 +0000 (22:47 +0100)]
Make float to string casts locale-independent
From now on, float to string casting will always behave locale-independently.
RFC: https://wiki.php.net/rfc/locale_independent_float_to_string
Closes GH-5224
Co-authored-by: George Peter Banyard <girgias@php.net>
Nikita Popov [Thu, 7 May 2020 16:50:42 +0000 (18:50 +0200)]
Ensure ctype_string is NULL for C locale
We already document that this is the case, but currently it's only
true if setlocale() has not been called. Make sure ctype_string is
always NULL, even with an explicit "C" locale call, so we can
more efficiently check whether we are in the "C" locale.
Nikita Popov [Thu, 7 May 2020 16:36:48 +0000 (18:36 +0200)]
Remove redundant htmlentities() tests
Test 04 and 15 are the same as 02 and 03, just for different
encodings. They don't add value, but their execution depends
on available locales, so they're easy to miss...
Nikita Popov [Thu, 7 May 2020 13:18:52 +0000 (15:18 +0200)]
Don't respect mbstring.internal_encoding in htmlentities()
htmlentities() has nothing to do with mbstring and should not
depend on its ini settings. It should only respect the global
default_charset and internal_encoding settings. This is exactly
why they were introduced...
Nikita Popov [Thu, 7 May 2020 13:46:08 +0000 (15:46 +0200)]
Add quiet parameter to internal HTML entities API
In some places, we need to make sure that no warnings are thrown
due to unknown encoding. The error reporting code tried to avoid
this by determining a "safe charset", but this introduces subtle
discrepancies in which charset is picked (normally
internal_encoding takes precedence). Avoid this by suppressing
the warning in the first place.
While here, use the fallback logic to print error messages with
substitution characters more consistently, to avoid skipping
parts of the error message entirely.
Nikita Popov [Thu, 7 May 2020 08:45:49 +0000 (10:45 +0200)]
Only allow "pass" as input/output encoding
"pass" is not a real encoding, it just means "don't perform any
conversion". Using it as an internal encoding or passing it to
any of the mbstring() function will not work (and on master commonly
assert).
Nikita Popov [Thu, 7 May 2020 08:15:57 +0000 (10:15 +0200)]
Return false from failed mb_convert_variables()
If we fail to detect the encoding return false, just like
mb_convert_encoding() does, and the implementation here clearly
intended. Previously the "pass" pseudo-incoding was returned.
We map the POSIX semantics of `IPC_PRIVATE` by creating unnamed file
mapping objects on Windows. While that is not particularly useful for
ext/shmop, which is the only bundled extension which uses `shmget()`,
it may be useful for external extensions.
Despite the docs claiming that data: wrappers would not be writable[1],
they are implemented as writing to a memory stream. That does not seem
to be particularly sensible, so we disallow writing altogether.
Nikita Popov [Sat, 2 May 2020 13:33:29 +0000 (15:33 +0200)]
Remove is_persistent flag from proc_open implementation
We don't support persistent proc_open handles and have no plan
to suppor them. The mixture of persistent and non-persistent
allocations functions in this code is somewhat confusing to read.
Alex Dowad [Wed, 22 Apr 2020 18:52:16 +0000 (20:52 +0200)]
Avoid spurious failures of MySQL INSERT packet overflow test
This test creates a MySQL table called 'test'. In several cases, I have seen a spurious
test failure (in CI) with an error message saying: "table 'test' already exists".
It may be that another test had used a table with the same name and not cleaned it out
correctly. Or maybe we have multiple tests running in parallel in some CI environments,
or the same test DB being used for multiple runs of the test suite.
In any case, change the table name so it is exclusive to this test case only. Also, if
the test table exists at the beginning of the test, drop it.
Alex Dowad [Wed, 22 Apr 2020 18:45:25 +0000 (20:45 +0200)]
Try to make regression test for Bug #69900 consistent
It has been observed that in rare cases, this regression test has spurious failures in CI.
Try increasing the threshold for failure a bit and see if this makes it pass consistently.