]>
granicus.if.org Git - php/log
George Peter Banyard [Fri, 3 Apr 2020 17:14:42 +0000 (19:14 +0200)]
Promote some warnings to ValueError in mbstring
Promoted warnings are:
* Empty encoding lists
* Unknown language
* Start and Width out of bound
George Peter Banyard [Fri, 3 Apr 2020 16:20:43 +0000 (18:20 +0200)]
Convert some if blocks to assertions
Máté Kocsis [Sat, 4 Apr 2020 21:51:10 +0000 (23:51 +0200)]
Generate functions entries from stubs for another set of extensions
Closes GH-5351
Máté Kocsis [Sat, 4 Apr 2020 22:03:08 +0000 (00:03 +0200)]
Move variable declaration closer to its usage
Máté Kocsis [Sat, 4 Apr 2020 19:26:46 +0000 (21:26 +0200)]
Improve gen_stub.php
Closes GH-5350
Add support for generating deprecated function entries, as well as forward declaration
of function aliases.
Máté Kocsis [Sat, 4 Apr 2020 18:41:42 +0000 (20:41 +0200)]
Generate function entries from stubs for a couple of extensions
Closes GH-5347
Máté Kocsis [Sat, 4 Apr 2020 11:03:16 +0000 (13:03 +0200)]
Annotate function aliases in stubs
George Peter Banyard [Fri, 3 Apr 2020 20:23:03 +0000 (22:23 +0200)]
Merge branch 'PHP-7.4'
George Peter Banyard [Fri, 3 Apr 2020 20:10:56 +0000 (22:10 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
George Peter Banyard [Fri, 3 Apr 2020 20:03:00 +0000 (22:03 +0200)]
Went to fast and forgot to update tests
However due to the really lax conversion to integer all strings pass as 0
George Peter Banyard [Fri, 3 Apr 2020 19:30:35 +0000 (21:30 +0200)]
Merge branch 'PHP-7.4'
George Peter Banyard [Fri, 3 Apr 2020 19:28:07 +0000 (21:28 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
George Peter Banyard [Fri, 3 Apr 2020 19:16:04 +0000 (21:16 +0200)]
Fix Bug #79448 0 is a valid Unicode codepoint, but mb_substitute_character(0) fails
Nikita Popov [Fri, 3 Apr 2020 16:21:40 +0000 (18:21 +0200)]
Fix stub for zend_terminate_string()
Nikita Popov [Fri, 3 Apr 2020 14:49:11 +0000 (16:49 +0200)]
Verify that all stubs have a return type
Nikita Popov [Fri, 3 Apr 2020 14:18:47 +0000 (16:18 +0200)]
Stubs: Store information per-class
We'll need this if we want to generate method entries.
Nikita Popov [Fri, 3 Apr 2020 13:10:30 +0000 (15:10 +0200)]
Remove now unnecessary PHP_FUNCTION() declarations
Nikita Popov [Fri, 21 Feb 2020 14:08:56 +0000 (15:08 +0100)]
Generate function entries from stubs
If @generate-function-entries is specified in the stub file,
also generate function entries for the extension.
Currently limited to free functions only.
Máté Kocsis [Sun, 29 Mar 2020 18:24:16 +0000 (20:24 +0200)]
Do not include the same stub multiple times
Closes GH-5322
Christoph M. Becker [Fri, 3 Apr 2020 12:11:04 +0000 (14:11 +0200)]
Fix #68690: Hypothetical off-by-one condition
We fix this, even though `filter->cache == jisx0213_u2_tbl_len` can
never be true here.
George Peter Banyard [Wed, 1 Apr 2020 12:40:15 +0000 (14:40 +0200)]
Promote unknown encoding throws in encoding array/string list
For the string list we emit still emit a warning by comparing arg_num to 0
Closes GH-5337
Remi Collet [Thu, 2 Apr 2020 14:48:43 +0000 (16:48 +0200)]
add some output when generating arginfo
Remi Collet [Thu, 2 Apr 2020 14:34:05 +0000 (16:34 +0200)]
Move gen_stub.php to build directory and install it so phpize can take care of it, and thus extension can use it as it is already in Makefile
Nikita Popov [Fri, 3 Apr 2020 08:06:52 +0000 (10:06 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix incorrect free for last_message
Nikita Popov [Fri, 3 Apr 2020 08:06:09 +0000 (10:06 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix incorrect free for last_message
Qianqian Bu [Fri, 3 Apr 2020 07:44:41 +0000 (15:44 +0800)]
Fix incorrect free for last_message
In commit
a7305eb539596e175bd6c3ae9a20953358c5d677 the last_message
field of the connection object was changed to be always non-persistent.
But there is a place on change_user path that still treats it
depending on conn->persistent flag. This will cause PHP crash after
com_change_user success when there is last_message set
George Peter Banyard [Thu, 2 Apr 2020 20:38:28 +0000 (22:38 +0200)]
Refactor mb_substr_count()
Promote empty needle warning to ValueError
Convert if branch into an assertion as if mbfl_substr_count fails this now implies a bug
Thus mb_substr_count() can only return int now, fix stubs accordingly
George Peter Banyard [Thu, 2 Apr 2020 20:10:02 +0000 (22:10 +0200)]
Convert if branch to assertion in mb_strlen
This operation should never fail, therefore it's converted to an assertion.
Thus this mb_strlen() can now only return int, fix stubs accordingly
George Peter Banyard [Thu, 2 Apr 2020 19:57:38 +0000 (21:57 +0200)]
Promote mb_str_split warning to ValueError
Also add a TODO about documenting this funcion on PHP.net
Convert some checks to assertions as if they don't hold something went wrong during memory allocation
Due to these changes this function cannot return false anymore, fix stubs accordingly
George Peter Banyard [Thu, 2 Apr 2020 18:48:09 +0000 (20:48 +0200)]
Merge mb_strstr() variants under a common implementation
This reduces heavy ducplicate code
George Peter Banyard [Thu, 2 Apr 2020 17:41:30 +0000 (19:41 +0200)]
Improve code flow
These nested if-else blocks are unnecessary since we return early.
George Peter Banyard [Thu, 2 Apr 2020 16:43:57 +0000 (18:43 +0200)]
Use ZEND_NUM_ARGS() macro instead of custom variable
Also why on earth would someone do this?
George Peter Banyard [Thu, 2 Apr 2020 16:35:20 +0000 (18:35 +0200)]
Promote empty string warning to ValueError in mb_ord()
Nikita Popov [Thu, 2 Apr 2020 14:34:51 +0000 (16:34 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fixed bug #79434
Nikita Popov [Thu, 2 Apr 2020 14:34:21 +0000 (16:34 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fixed bug #79434
Nikita Popov [Thu, 2 Apr 2020 14:32:57 +0000 (16:32 +0200)]
Fixed bug #79434
Matteo Beccati [Thu, 2 Apr 2020 14:17:24 +0000 (16:17 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Skip fpm tests not designed to be run as root
Allow fpm tests to be run with long socket path
Matteo Beccati [Wed, 1 Apr 2020 16:28:34 +0000 (18:28 +0200)]
Skip fpm tests not designed to be run as root
When running as root with TEST_FPM_RUN_AS_ROOT=1
Matteo Beccati [Wed, 1 Apr 2020 16:14:25 +0000 (18:14 +0200)]
Allow fpm tests to be run with long socket path
Socket path is restricted to ~100 bytes, so we can use
the system temp dir if the path ends up too long.
Remi Collet [Thu, 2 Apr 2020 12:58:13 +0000 (14:58 +0200)]
news / UPGRADING for zip 1.19.0
Remi Collet [Thu, 2 Apr 2020 12:40:05 +0000 (14:40 +0200)]
- add ZipArchive::EM_UNKNOWN constant - add ZipArchive::EM_TRAD_PKWARE constant - cleanup hack for libzip 1.3.1 (have only exist for a few days) - add ZipArchive::isCompressionMethodSupported() method (libzip 1.7.0) - add ZipArchive::isEncryptionMethodSupported() method (libzip 1.7.0) - bump version to 1.19.0-dev
Christoph M. Becker [Thu, 2 Apr 2020 11:06:19 +0000 (13:06 +0200)]
Fix #47983: mixed LF and CRLF line endings in mail()
Email headers are supposed to be separated with CRLF. Period.
Christoph M. Becker [Thu, 2 Apr 2020 10:50:38 +0000 (12:50 +0200)]
Prevent imap mail tests from borking instead of skipping
As of commit
e49593a [1], run-tests.php is rather picky regarding the
output of SKIPIF sections, so we have to suppress warnings for failing
imap_open().
[1] <http://git.php.net/?p=php-src.git;a=commit;h=
e49593a7c3159a5673ce74b4e5133f1264dc313f >
Remi Collet [Thu, 2 Apr 2020 10:26:34 +0000 (12:26 +0200)]
use a better setter for zip_error_t
Nikita Popov [Thu, 2 Apr 2020 09:25:41 +0000 (11:25 +0200)]
Remove <default> prefix from reflection dump
This really doesn't add anything, and only makes for confusing
terminology. Only marking properties as dynamic is sufficient.
Nikita Popov [Thu, 2 Apr 2020 09:21:48 +0000 (11:21 +0200)]
Display property default value in reflection dumps
Nikita Popov [Thu, 2 Apr 2020 09:05:04 +0000 (11:05 +0200)]
Show property type in reflection export
Nikita Popov [Thu, 2 Apr 2020 08:54:32 +0000 (10:54 +0200)]
Avoid control flow warning
Christoph M. Becker [Wed, 1 Apr 2020 17:21:46 +0000 (19:21 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Enable error diagnostic for check_default_conf_path.phpt
Christoph M. Becker [Wed, 1 Apr 2020 17:20:35 +0000 (19:20 +0200)]
Enable error diagnostic for check_default_conf_path.phpt
Otherwise we have no clue why the test failed, if the regex didn't
match.
Nikita Popov [Wed, 1 Apr 2020 12:49:52 +0000 (14:49 +0200)]
Remove unnecessary check in runtime_compile_time_binary_operands.phpt
Now that operator errors are detected more accurately, we no longer
have any cases where we throw a compile-time error instead of a
run-time exception, so we can drop this check now.
Nikita Popov [Wed, 1 Apr 2020 12:47:21 +0000 (14:47 +0200)]
Make division by zero error check more accurate
For division (rather than modulus) we should check the double
value, otherwise the result might be zero after integer truncation,
but not zero as a floating point value.
Nikita Popov [Wed, 1 Apr 2020 11:02:58 +0000 (13:02 +0200)]
Unify checks for binary operator errors for ct eval
Move everything into one function and share it with opcache.
This fixes some discrepancies.
Nikita Popov [Wed, 1 Apr 2020 12:35:01 +0000 (14:35 +0200)]
Don't convert binop operand types in opcache
This may produce different behavior if operator overloading is
involved, and may change the error message.
If there's strong interest, this could be done in the DFA pass
with available type information. It does not look particularly
practically useful to me though.
Nikita Popov [Wed, 1 Apr 2020 12:23:07 +0000 (14:23 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix literal compaction collision between string and double
Nikita Popov [Wed, 1 Apr 2020 12:21:59 +0000 (14:21 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix literal compaction collision between string and double
Nikita Popov [Wed, 1 Apr 2020 12:20:59 +0000 (14:20 +0200)]
Fix literal compaction collision between string and double
For the sake of simplicity I'm using a separate hashtable, rather
than trying to do hash perturabation on the double strings.
Nikita Popov [Wed, 1 Apr 2020 08:05:26 +0000 (10:05 +0200)]
Improve "unsupported operands" error
By mentioning the operand types. We can do that now, as the
original operand types now remain available.
Closes GH-5330.
Nikita Popov [Wed, 1 Apr 2020 08:15:03 +0000 (10:15 +0200)]
Remove op_func from TRY_BINARY_OP1 macro
And move the operator overloading helpers into zend_operators.c,
there's no reason for them to be in the header.
Christoph M. Becker [Wed, 1 Apr 2020 07:29:07 +0000 (09:29 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Add NEWS entryc [ci skip]
Christoph M. Becker [Wed, 1 Apr 2020 07:28:39 +0000 (09:28 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Add NEWS entryc [ci skip]
Christoph M. Becker [Wed, 1 Apr 2020 07:26:20 +0000 (09:26 +0200)]
Add NEWS entryc [ci skip]
George Peter Banyard [Wed, 1 Apr 2020 02:55:35 +0000 (04:55 +0200)]
Merge branch 'PHP-7.4'
George Peter Banyard [Wed, 1 Apr 2020 02:34:09 +0000 (04:34 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
George Peter Banyard [Wed, 1 Apr 2020 02:29:20 +0000 (04:29 +0200)]
Fix bug 79441
George Peter Banyard [Tue, 31 Mar 2020 22:54:36 +0000 (00:54 +0200)]
Promote unsupported encoding warnings to ValueError
George Peter Banyard [Tue, 31 Mar 2020 16:55:31 +0000 (18:55 +0200)]
Use php_mb_get_encoding instead of mbfl_name2encoding to get encoding
This reduces the number of places where the error message template is used.
Also promote the mb_check_encoding() warning to ValueError and add a test to cover the behaviour.
Nikita Popov [Tue, 31 Mar 2020 19:47:55 +0000 (21:47 +0200)]
Move encoding fetching out of php_mb_convert_encoding()
Nikita Popov [Tue, 31 Mar 2020 19:01:42 +0000 (21:01 +0200)]
Remove unnecesary check in php_mb_check_encoding()
The caller makes sure that this is not NULL.
Nikita Popov [Tue, 31 Mar 2020 16:03:30 +0000 (18:03 +0200)]
Refactor operator implementations
Instead of looping, use straight-line code with the following
layout:
1. Try to apply the base operation on the dereferenced operands.
2. Try overloaded object operations.
3. Try to convert operands to number, else error out.
4. Apply the base operation on the converted operands.
This makes the code easier to reason about and fixes some edge-case
bugs:
1. We should only try invoking operator overloading once prior to
type conversion. Previously it was invoked both before and after
type conversion.
2. We should not modify any values if an exception is thrown.
Previously we sometimes modified the LHS of a compound assignment
operator.
3. If conversion of the first operand fails, we no longer try to
convert the second operand. I think the previous behavior here
was fine as well, but this still seems a more typical.
This will also make some followup changes I have in mind simpler.
George Peter Banyard [Tue, 31 Mar 2020 18:23:57 +0000 (20:23 +0200)]
Use explicit helper
George Peter Banyard [Tue, 31 Mar 2020 18:02:00 +0000 (20:02 +0200)]
Encoding argument is always MBREX(current_mbctype)
Nikita Popov [Tue, 31 Mar 2020 16:35:17 +0000 (18:35 +0200)]
Add additional operator exception handling tests
These show that we may lose the old value of the LHS of a compound
assignment operator in some cases.
Nikita Popov [Tue, 31 Mar 2020 15:31:14 +0000 (17:31 +0200)]
Remove unused argument form convert_object_to_type()
Máté Kocsis [Mon, 30 Mar 2020 20:49:55 +0000 (22:49 +0200)]
Display nullability in type error messages for internal functions
Closes GH-5327
Nikita Popov [Tue, 31 Mar 2020 12:52:59 +0000 (14:52 +0200)]
Clean up silent/noisy flag in convert_to_number
George Peter Banyard [Sat, 28 Mar 2020 19:31:18 +0000 (20:31 +0100)]
Convert some unknown encoding warnings to ValueErrors in ext/mbstring
Promotes only the warnings where the encoding comes only from a string.
Functions which accept an array of encodings will be fixed at a later stage.
Closes GH-5317
George Peter Banyard [Sun, 29 Mar 2020 22:40:18 +0000 (00:40 +0200)]
Promote some warnings to Errors in Zend basic functions
Closes GH-5325
Derick Rethans [Tue, 31 Mar 2020 14:01:07 +0000 (15:01 +0100)]
Merge branch 'PHP-7.4'
Derick Rethans [Tue, 31 Mar 2020 13:57:12 +0000 (14:57 +0100)]
The 7.4 branch is now for 7.4.6
Nikita Popov [Tue, 31 Mar 2020 10:17:32 +0000 (12:17 +0200)]
Make cast_object handler required
Avoid subtle differences in behavior depending on whether the
handler is absent or returns FAILURE.
If you previously set cast_object to NULL, create a handler that
always returns FAILURE instead.
Máté Kocsis [Mon, 30 Mar 2020 15:23:03 +0000 (17:23 +0200)]
Improve undefined variable error messages
Closes GH-5312
Nikita Popov [Tue, 31 Mar 2020 10:48:57 +0000 (12:48 +0200)]
Clarify SimpleXML comparison logic
Nikita Popov [Tue, 31 Mar 2020 10:36:48 +0000 (12:36 +0200)]
Add a ZEND_UNCOMPARABLE value
To explicitly indicate that objects are uncomparable. For now
this has no functional difference from the usual 1 return value,
but makes intent clearer.
Nikita Popov [Tue, 31 Mar 2020 10:04:59 +0000 (12:04 +0200)]
Report object cast failures internally
Make cast_object return FAILURE for casts to int/float, rather than
throwing a notice and returning SUCCESS. Instead move the emission
of the notice to the code invoking cast_object. This will allow us
to customize the behavior per call-site.
This change is written to be NFC, and the code in
zend_std_compare_objects() should illustrate the current behavior
doesn't make a lot of sense.
Nikita Popov [Tue, 31 Mar 2020 09:06:15 +0000 (11:06 +0200)]
Make sure php_get_internal_encoding() returns non-empty
Even if default_charset is set to "", we should still return
"UTF-8" as the default value here. Setting default_charset to ""
suppresses the header emission, but shouldn't change anything
about our encoding defaults.
Nikita Popov [Tue, 31 Mar 2020 08:46:44 +0000 (10:46 +0200)]
Make sure mbstring.internal_encoding deprecation is always thrown
It was not thrown if the setting was specified via -d at least.
Christoph M. Becker [Tue, 31 Mar 2020 08:26:01 +0000 (10:26 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Next is 7.3.18
Christoph M. Becker [Tue, 31 Mar 2020 08:24:15 +0000 (10:24 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Next is 7.3.18
Christoph M. Becker [Tue, 31 Mar 2020 08:22:55 +0000 (10:22 +0200)]
Next is 7.3.18
Christoph M. Becker [Tue, 31 Mar 2020 06:41:08 +0000 (08:41 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix #79413: session_create_id() fails for active sessions
Christoph M. Becker [Tue, 31 Mar 2020 06:39:34 +0000 (08:39 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix #79413: session_create_id() fails for active sessions
Christoph M. Becker [Thu, 26 Mar 2020 18:01:33 +0000 (19:01 +0100)]
Fix #79413: session_create_id() fails for active sessions
The comment on `PS_VALIDATE_SID_FUNC(files)` is very clear that the
function is supposed to return `SUCCESS` if the session already exists.
So to detect a collision, we have to check for `SUCCESS`, not
`FAILURE`.
We also fix the wrong condition in session_regenerate_id() as well.
George Peter Banyard [Sun, 29 Mar 2020 00:10:15 +0000 (01:10 +0100)]
Drop wchar header check as always defined since C95
George Peter Banyard [Mon, 30 Mar 2020 02:11:12 +0000 (04:11 +0200)]
Fix format for tm member objects as they are stored as integers
Closes GH-5326
Nikita Popov [Mon, 30 Mar 2020 14:27:38 +0000 (16:27 +0200)]
Clarify that return throws
Nikita Popov [Mon, 30 Mar 2020 14:26:28 +0000 (16:26 +0200)]
mb_detect_order(): Use proper array|string argument
Nikita Popov [Mon, 30 Mar 2020 14:17:35 +0000 (16:17 +0200)]
Remove persistent arg from parse_encoding_array()
It is always zero.
Nikita Popov [Mon, 30 Mar 2020 14:13:36 +0000 (16:13 +0200)]
mb_check_encoding(): Make var a proper array|string arg
Nikita Popov [Mon, 30 Mar 2020 14:06:41 +0000 (16:06 +0200)]
mb_detect_encoding(): Use proper array|string parameter
Needed to add support for nullabiltiy in some places.