summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* for consistency use for all *Name methodsRemi Collet2020-09-232-11/+9
|
* SplFixedArray is Aggregate, not IterableAlex Dowad2020-09-2311-364/+162
| | | | | | | | | | | | | | | | | | | | | | | | One strange feature of SplFixedArray was that it could not be used in nested foreach loops. If one did so, the inner loop would overwrite the iteration state of the outer loop. To illustrate: $spl = SplFixedArray::fromArray([0, 1]); foreach ($spl as $a) { foreach ($spl as $b) { echo "$a $b"; } } Would only print two lines: 0 0 0 1 Use the new InternalIterator feature which was introduced in ff19ec2df3 to convert SplFixedArray to an Aggregate rather than Iterable. As a bonus, we get to trim down some ugly code! Yay!
* Tweak some macro definition on WindowsGeorge Peter Banyard2020-09-226-43/+5
| | | | Closes GH-5606
* Fix double free on unpack errorNikita Popov2020-09-221-2/+0
|
* Fix extra args leakDmitry Stogov2020-09-232-0/+10
|
* Promote warnings to error in DOM extensionGeorge Peter Banyard2020-09-2225-143/+208
| | | | Closes GH-5418
* Drop usage of E_RECOVERABLE_ERROR in Session extensionGeorge Peter Banyard2020-09-225-14/+31
|
* Add proper default values for optional arguments in IMAPGeorge Peter Banyard2020-09-224-41/+31
| | | | Closes GH-6179
* Refactor imap_mail()'s internal implementation to use zend_stringsGeorge Peter Banyard2020-09-221-52/+55
|
* Try to fix testNikita Popov2020-09-221-2/+1
|
* Handle out-of-bounds offset consistently in grapheme_* APINikita Popov2020-09-223-32/+97
| | | | | | Make sure we throw the same kind of error regardless of whether the offset is out-of-bounds in the fast path or in the slow path.
* Fix grapheme out of bounds checkNikita Popov2020-09-223-2/+97
| | | | An offset equal to the string length is not out of bounds.
* Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-222-6/+35
|\ | | | | | | | | * PHP-7.4: Fix #76943: Inconsistent stream_wrapper_restore() errors
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-223-6/+36
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #76943: Inconsistent stream_wrapper_restore() errors
| | * Fix #76943: Inconsistent stream_wrapper_restore() errorsChristoph M. Becker2020-09-223-6/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If restoring of any not registered built-in wrapper is requested, the function is supposed to fail with a warning, so we have to check this condition first. Furthermore, to be able to detect whether a built-in wrapper has been changed, it is not sufficient to check whether *any* userland wrapper has been registered, but rather whether the specific wrapper has been modified. Closes GH-6183.
* | | Skip IMAP test which chokes on ASAN buildGeorge Peter Banyard2020-09-221-0/+1
| | |
* | | Promote pack/unpack format errorsNikita Popov2020-09-228-79/+81
| | | | | | | | | | | | | | | | | | | | | Errors related to invalid format strings (unlike data mismatch errors) should throw ValueError. Closes GH-6185.
* | | Convert unpack offset warning to ValueErrorNikita Popov2020-09-222-2/+16
| | |
* | | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-221-1/+17
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79423: copy command is limited to size of file it can copy
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-09-222-1/+19
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #79423: copy command is limited to size of file it can copy
| | * Fix #79423: copy command is limited to size of file it can copyChristoph M. Becker2020-09-222-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Passing `NULL` as `lpFileSizeHigh` to `GetFileSize()` gives wrong results for files larger than 0xFFFFFFFF bytes. We fix this by using `GetFileSizeEx()`, and let the mapping fail, if the file size is too large for the architecture. Closes GH-5319.
* | | Use C zpp for get_class_vars()Nikita Popov2020-09-225-19/+21
| | |
* | | Support uuencoding empty stringNikita Popov2020-09-225-10/+17
| | | | | | | | | | | | | | | | | | | | | Cross checking implementations from other languages, empty strings are always allowed. PHP's output is peculiar due to it's insistence to encode a trailing \0, but otherwise sensible and does round-trip as expected.
* | | stream_bucket_new() cannot return falseNikita Popov2020-09-224-8/+6
| | | | | | | | | | | | php_stream_bucket_new() is infallible.
* | | stream_get_transports/wrappers cannot return falseNikita Popov2020-09-224-25/+19
| | | | | | | | | | | | These may return an empty array, but not false.
* | | Don't return false for empty string in soundex()Nikita Popov2020-09-225-15/+9
| | | | | | | | | | | | | | | | | | | | | Return "0000" instead of false to have a consistent return type. "0000" is already a possible return value if the string doesn't contain any letters, such as with soundex(" "). We can treat the case of soundex("") exactly the same.
* | | Skip if https wrapper isn't presentLevi Morrison2020-09-221-0/+1
| | |
* | | http_build_query() cannot failNikita Popov2020-09-225-20/+10
| | | | | | | | | | | | | | | Assert that ht is not null and make php_url_encode_hash_ex() return void to clarify that this is an infallible function.
* | | html_entity_decode() cannot failNikita Popov2020-09-223-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | php_unescape_html_entities() never returns null, so this function can never return false. php_unescape_html_entities() probably should be failing with OOM for the "overflow" case, but even if it did, it would not be signalled through a false return value.
* | | Validate phonemes parameter of metaphone()Nikita Popov2020-09-224-36/+24
| | | | | | | | | | | | And thus avoid the false return value.
* | | substr_compare() cannot return falseNikita Popov2020-09-222-3/+3
| | |
* | | Check string bounds in strspn/strcspnNikita Popov2020-09-2215-9640/+4682
| | | | | | | | | | | | | | | strspn/strcspn are string search functions, and as such should throw ValueError on out-of-bounds offsets, just like strpos etc do.
* | | Promote substr_replace warningsNikita Popov2020-09-222-85/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation here was pretty confused. In reality the only error condition it has right now is that for a string input, from & length cannot be arrays. The fact that the array lengths are the same was probably supposed to be checked for the case of array input, as it wouldn't matter otherwise.
* | | substr_replace() cannot return falseNikita Popov2020-09-223-4/+4
| | |
* | | Fixed minor typo in commentIkko Ashimine2020-09-221-1/+1
| | | | | | | | | | | | | | | | | | Initiailize -> Initialize Closes GH-6181.
* | | Fixed INIT_METHOD_CALL + IS_VAR + reference in tracing JITDmitry Stogov2020-09-222-4/+47
| | |
* | | Fixed incorrect assumption about sizeof(zend_reference)Dmitry Stogov2020-09-211-9/+9
| | |
* | | Ficed 32-bit JIT (inconsistent CPU stack state)Dmitry Stogov2020-09-211-3/+3
| | |
* | | Promote count() warning to TypeErrorGeorge Peter Banyard2020-09-2111-1069/+117
| | | | | | | | | | | | Closes GH-6180
* | | Fixed incorrect JIT for FETCH_THIS+SEND_REFDmitry Stogov2020-09-212-1/+30
| | |
* | | Drop -1 mode for collator_is_numeric()George Peter Banyard2020-09-213-7/+4
| | | | | | | | | | | | It is used only once with allow_errors enabled
* | | Drop Hex support in numeric strings for Intl collatorGeorge Peter Banyard2020-09-211-12/+1
| | | | | | | | | | | | | | | | | | Support for this was removed in PHP 7.0. See: https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings
* | | Return empty array for no rows in pg_fetch_all()Nikita Popov2020-09-217-16/+19
| | | | | | | | | | | | | | | This makes it line up with pg_fetch_all_columns(), as well as similar functions in other exts, such as mysqli_fetch_all().
* | | Throw warning for failed object to int/float conversionNikita Popov2020-09-2117-58/+41
| | | | | | | | | | | | | | | | | | We previously couldn't increase the error level here because it was coupled to comparison handling. This is no longer the case in PHP 8.
* | | Convert exception instanceof checks to assertionsNikita Popov2020-09-211-11/+8
| | |
* | | Make constant redeclaration a warningNikita Popov2020-09-219-10/+10
| | | | | | | | | | | | | | | | | | We missed the change to make this an Error exception in PHP 8, but at least elevate it to a warning, to avoid a notice -> exception jump at a later time.
* | | Promote invalid field to ValueError in pgsqlNikita Popov2020-09-215-53/+128
| | | | | | | | | | | | | | | | | | | | | | | | The same error condition is a ValueError in mysqli, be consistent. Additionally, do not display the argument name for these errors. As the signatures are overloaded, the argument name may not match the meaning at all.
* | | Remove redundant checkNikita Popov2020-09-211-5/+0
| | | | | | | | | | | | This was already checked directly above.
* | | Check linker compatibility directly from HMODULEChristoph M. Becker2020-09-218-54/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking the linker compatibility with extranous `ImageLoad()` calls is possible, but unnecessary, since the modules are either already loaded or loaded shortly afterwards, so that we can get the required information directly from the module handles. And actually, doing `ImageLoad()` as well as `LoadLibrary()` leaves a tiny room for a race condition, because both functions will lookup the module in the search path, so there is no *guarantee* that both are dealing with the same module. Dropping the `ImageLoad()` calls also has the advantage to no longer face the issue reported in bug #79557. A very minor additional advantage is that we no longer have to link against Imagehlp.dll. Furthermore, there is no need to check for CRT compatibility multiple times, so we can simplify the signature of `php_win32_crt_compatible`, and at the same time clean up main.c a bit. These changes require to change the signature of the exported `php_win32_image_compatible` and `php_win32_crt_compatible` functions, which now expect a `HMODULE` and nothing, respectively, instead of the module name.
* | | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-09-213-17/+43
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix mmap copying