]> granicus.if.org Git - php/log
php
4 years agoUpdate ext/odbc stub hash
Máté Kocsis [Fri, 25 Sep 2020 09:19:50 +0000 (11:19 +0200)]
Update ext/odbc stub hash

4 years agoImprove parameter names in ext/curl
Máté Kocsis [Thu, 17 Sep 2020 18:15:01 +0000 (20:15 +0200)]
Improve parameter names in ext/curl

Closes GH-6155

4 years agoUnify 32-bit/64-bit str_split tests
Nikita Popov [Fri, 25 Sep 2020 08:03:41 +0000 (10:03 +0200)]
Unify 32-bit/64-bit str_split tests

The 32-bit tests work on both 32-bit and 64-bit. I dropped the
64-bit variants as they only test one additional case that I don't
think adds particular value.

4 years agoNormalize substr() behavior
Nikita Popov [Tue, 22 Sep 2020 07:56:08 +0000 (09:56 +0200)]
Normalize substr() behavior

Make the behavior of substr(), mb_substr(), iconv_substr() and
grapheme_substr() consistent when it comes to the handling of
out of bounds offsets. substr() will now always clamp out of
bounds offsets to the string boundary. Cases that previously
returned false will now return an empty string. This means that
substr() itself *always* returns a string now (like mb_substr()
already did before.)

Closes GH-6182.

4 years agoFix #64937: Firebird PDO preprocessing sql
Simonov Denis [Wed, 18 Dec 2019 19:42:07 +0000 (20:42 +0100)]
Fix #64937: Firebird PDO preprocessing sql

This patch fixes some problems with preprocessing SQL queries.

* The new algorithm takes into account single-line and multi-line
  comments and ignores the ":" and "?" Parameter markers in them.

* The algorithm allows the EXECUTE BLOCK statement to be processed
  correctly. For this statement, it is necessary to search for
  parameter markers between EXECUTE BLOCK and AS, the rest should be
  left as is.

The SQL preprocessing code has been ported from Firebird to handle
EXECUTE STATEMENT.

Closes GH-4920.

4 years agoRemove outdated link to bug report
Christoph M. Becker [Thu, 24 Sep 2020 21:20:29 +0000 (23:20 +0200)]
Remove outdated link to bug report

That bug has been fixed, so no need to keep that link any longer.

4 years agoFix UNKNOWN default values in ext/odbc
Máté Kocsis [Thu, 17 Sep 2020 17:35:40 +0000 (19:35 +0200)]
Fix UNKNOWN default values in ext/odbc

Closes GH-6154

4 years agoImprove parameter names in ext/hash and ext/openssl
Máté Kocsis [Thu, 17 Sep 2020 18:39:21 +0000 (20:39 +0200)]
Improve parameter names in ext/hash and ext/openssl

Closes GH-6156

4 years agoUpdate fileinfo parameter names
Nikita Popov [Thu, 24 Sep 2020 13:37:10 +0000 (15:37 +0200)]
Update fileinfo parameter names

Closes GH-6206.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Thu, 24 Sep 2020 15:14:22 +0000 (17:14 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Use proper skipif section

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 24 Sep 2020 15:13:01 +0000 (17:13 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Use proper skipif section

4 years agoUse proper skipif section
Christoph M. Becker [Thu, 24 Sep 2020 15:10:09 +0000 (17:10 +0200)]
Use proper skipif section

The ODBC tests have to be skipped if no connection to the server can be
established.

4 years agoSkip imap_lsub_basic.phpt under asan
Nikita Popov [Thu, 24 Sep 2020 15:03:53 +0000 (17:03 +0200)]
Skip imap_lsub_basic.phpt under asan

LeakSanitizer fails on Azure with:

> Tracer caught signal 11: addr=0x0 pc=0x7f86cde7c8b0 sp=0x7f86c46bcce0

4 years agoAdd option to print parameter name stats to gen_stub
Nikita Popov [Thu, 24 Sep 2020 13:16:07 +0000 (15:16 +0200)]
Add option to print parameter name stats to gen_stub

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Thu, 24 Sep 2020 10:23:08 +0000 (12:23 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #78470: odbc_specialcolumns() no longer accepts $nullable

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Thu, 24 Sep 2020 10:16:34 +0000 (12:16 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #78470: odbc_specialcolumns() no longer accepts $nullable

4 years agoFix #78470: odbc_specialcolumns() no longer accepts $nullable
Christoph M. Becker [Thu, 24 Sep 2020 08:30:41 +0000 (10:30 +0200)]
Fix #78470: odbc_specialcolumns() no longer accepts $nullable

It is mandatory to pass either `SQL_NO_NULLS` or `SQL_NULLABLE` as
tenth parameter to `SQLSpecialColumns()`; otherwise the function call
fails.  Therefore the user must be allowed to pass the desired value
as parameter to `odbc_specialcolumns()` again.

Closes GH-6200.

4 years agoFix test for cases where data sources are available
Christoph M. Becker [Thu, 24 Sep 2020 09:23:20 +0000 (11:23 +0200)]
Fix test for cases where data sources are available

That `bool(false)` is a relict of adapting the test expectations to the
warning promotions.

4 years agoSkip unnecessary unknown() frames
Nikita Popov [Wed, 23 Sep 2020 15:06:28 +0000 (17:06 +0200)]
Skip unnecessary unknown() frames

Noticed this while working on attributes strict_types handling.
We sometimes insert dummy frames internally, but I don't think
these should show up in debug_backtrace output unless they're
needed, either to display an include call or to preserve file/line
information that would otherwise get lost.

Closes GH-6195.

4 years agoMore precise type in mysqli_result constructor
Nikita Popov [Thu, 24 Sep 2020 07:54:59 +0000 (09:54 +0200)]
More precise type in mysqli_result constructor

This ctor requires a mysqli object. Possibly there was some
confusion with the mysqli_warning constructor here.

4 years agoClear error flag instead of toggling it
Christoph M. Becker [Wed, 23 Sep 2020 09:37:14 +0000 (11:37 +0200)]
Clear error flag instead of toggling it

The toggling of the `REPORT_ERRORS` looks fishy, and likely was
intented as clearing.

Closes GH-6190.

4 years agoImprove trace selection (avoid blacklisting of trace that may be linked).
Dmitry Stogov [Wed, 23 Sep 2020 20:50:44 +0000 (23:50 +0300)]
Improve trace selection (avoid blacklisting of trace that may be linked).

4 years agoPromote warnings to Error in IMAP extension
George Peter Banyard [Thu, 17 Sep 2020 15:22:01 +0000 (17:22 +0200)]
Promote warnings to Error in IMAP extension

Drop some dependencies on argc at the same time

Closes GH-6164

4 years agoReplace ZEND_JIT_TRACE_STOP_RETURN_HALT and ZEND_JIT_TRACE_STOP_HALT by separate...
Dmitry Stogov [Wed, 23 Sep 2020 12:44:04 +0000 (15:44 +0300)]
Replace ZEND_JIT_TRACE_STOP_RETURN_HALT and ZEND_JIT_TRACE_STOP_HALT by separate ZEND_JIT_TRACE_HALT flag.

4 years agoRemove unused --temp-urlbase option from run-tests.php
Nikita Popov [Wed, 23 Sep 2020 10:34:19 +0000 (12:34 +0200)]
Remove unused --temp-urlbase option from run-tests.php

This was part of the removed HTML functionality.

4 years agoFix #80139: copy_variation5.phpt fails when run on bind mount
Christoph M. Becker [Wed, 23 Sep 2020 10:13:35 +0000 (12:13 +0200)]
Fix #80139: copy_variation5.phpt fails when run on bind mount

This test case is not supposed to run on case-insensitive file system;
just checking for macOS/Windows doesn't cut it.

4 years agoImprove PDO::inTransaction() support for MySQL
twosee [Tue, 10 Dec 2019 06:55:10 +0000 (14:55 +0800)]
Improve PDO::inTransaction() support for MySQL

Closes GH-4996.

4 years agoClean up file created during testing
Christoph M. Becker [Wed, 23 Sep 2020 09:44:32 +0000 (11:44 +0200)]
Clean up file created during testing

4 years agoFix test case
Christoph M. Becker [Wed, 23 Sep 2020 09:20:30 +0000 (11:20 +0200)]
Fix test case

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Wed, 23 Sep 2020 09:14:06 +0000 (11:14 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #76735: Incorrect message in fopen on invalid mode

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Wed, 23 Sep 2020 08:54:40 +0000 (10:54 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #76735: Incorrect message in fopen on invalid mode

4 years agoFix #76735: Incorrect message in fopen on invalid mode
Christoph M. Becker [Tue, 22 Sep 2020 16:57:21 +0000 (18:57 +0200)]
Fix #76735: Incorrect message in fopen on invalid mode

We have to log errors in `stream_opener` callbacks to the wrapper's
error log, because otherwise we may pick up an unrelated `errno` or a
most generic message.

Closes GH-6187.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Wed, 23 Sep 2020 08:48:35 +0000 (10:48 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #77493: curl_basic_009 fails with newer curl versions

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Wed, 23 Sep 2020 08:44:06 +0000 (10:44 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #77493: curl_basic_009 fails with newer curl versions

4 years agoFix #77493: curl_basic_009 fails with newer curl versions
Christoph M. Becker [Wed, 23 Sep 2020 08:38:59 +0000 (10:38 +0200)]
Fix #77493: curl_basic_009 fails with newer curl versions

libcurl 7.62.0 introduced a maximum protocol length of 8, so this test
case failed with `CURLE_URL_MALFORMAT`.  While this is lifted to 40 as
of libcurl 7.65.0, and this test case has already been fixed with
commit e27301c[1], we restore the original intention to check for a
`CURLE_UNSUPPORTED_PROTOCOL ` error.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=e27301c7b37f6a1643a0dc1966919bd62a32bc74>

4 years agoConsistent error handling for fgetcsv/fputcsv
Nikita Popov [Tue, 22 Sep 2020 14:07:31 +0000 (16:07 +0200)]
Consistent error handling for fgetcsv/fputcsv

Normalize the behavior between the file functions and those on
SplFileObject.

Be consistent about throwing regardless of whether the delimiter etc
is empty or has too many characters. I don't think it's worthwhile
to distinguish these cases.

Back when we looked into this originally, there was some hope that
we might want to add support for multiple-character delimiter etc,
but after a cursory look, I really don't think this is going to
happen (for fputcsv maybe, but for fgetcsv this just makes an already
broken function much more complicated.)

Closes GH-6188.

4 years agoFix a few ZEND_UNREACHABLE() calls
Máté Kocsis [Wed, 23 Sep 2020 07:56:19 +0000 (09:56 +0200)]
Fix a few ZEND_UNREACHABLE() calls

4 years agoFix shift ub
Nikita Popov [Wed, 23 Sep 2020 08:04:32 +0000 (10:04 +0200)]
Fix shift ub

And typo in macro name

4 years agofor consistency use for all *Name methods
Remi Collet [Wed, 23 Sep 2020 07:31:44 +0000 (09:31 +0200)]
for consistency use  for all *Name methods

4 years agoSplFixedArray is Aggregate, not Iterable
Alex Dowad [Mon, 11 May 2020 18:32:13 +0000 (20:32 +0200)]
SplFixedArray is Aggregate, not Iterable

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!

4 years agoTweak some macro definition on Windows
George Peter Banyard [Wed, 20 May 2020 17:35:39 +0000 (19:35 +0200)]
Tweak some macro definition on Windows

Closes GH-5606

4 years agoFix double free on unpack error
Nikita Popov [Tue, 22 Sep 2020 21:31:56 +0000 (23:31 +0200)]
Fix double free on unpack error

4 years agoFix extra args leak
Dmitry Stogov [Tue, 22 Sep 2020 21:21:39 +0000 (00:21 +0300)]
Fix extra args leak

4 years agoPromote warnings to error in DOM extension
George Peter Banyard [Sun, 19 Apr 2020 12:35:25 +0000 (14:35 +0200)]
Promote warnings to error in DOM extension

Closes GH-5418

4 years agoDrop usage of E_RECOVERABLE_ERROR in Session extension
George Peter Banyard [Tue, 22 Sep 2020 17:32:21 +0000 (18:32 +0100)]
Drop usage of E_RECOVERABLE_ERROR in Session extension

4 years agoAdd proper default values for optional arguments in IMAP
George Peter Banyard [Mon, 21 Sep 2020 15:19:10 +0000 (16:19 +0100)]
Add proper default values for optional arguments in IMAP

Closes GH-6179

4 years agoRefactor imap_mail()'s internal implementation to use zend_strings
George Peter Banyard [Mon, 21 Sep 2020 15:11:18 +0000 (16:11 +0100)]
Refactor imap_mail()'s internal implementation to use zend_strings

4 years agoTry to fix test
Nikita Popov [Tue, 22 Sep 2020 15:04:06 +0000 (17:04 +0200)]
Try to fix test

4 years agoHandle out-of-bounds offset consistently in grapheme_* API
Nikita Popov [Tue, 22 Sep 2020 15:01:06 +0000 (17:01 +0200)]
Handle out-of-bounds offset consistently in grapheme_* API

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.

4 years agoFix grapheme out of bounds check
Nikita Popov [Tue, 22 Sep 2020 14:35:53 +0000 (16:35 +0200)]
Fix grapheme out of bounds check

An offset equal to the string length is not out of bounds.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Tue, 22 Sep 2020 14:14:03 +0000 (16:14 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #76943: Inconsistent stream_wrapper_restore() errors

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 22 Sep 2020 14:11:56 +0000 (16:11 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #76943: Inconsistent stream_wrapper_restore() errors

4 years agoFix #76943: Inconsistent stream_wrapper_restore() errors
Christoph M. Becker [Tue, 22 Sep 2020 11:01:32 +0000 (13:01 +0200)]
Fix #76943: Inconsistent stream_wrapper_restore() errors

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.

4 years agoSkip IMAP test which chokes on ASAN build
George Peter Banyard [Tue, 22 Sep 2020 13:43:31 +0000 (14:43 +0100)]
Skip IMAP test which chokes on ASAN build

4 years agoPromote pack/unpack format errors
Nikita Popov [Tue, 22 Sep 2020 12:08:13 +0000 (14:08 +0200)]
Promote pack/unpack format errors

Errors related to invalid format strings (unlike data mismatch
errors) should throw ValueError.

Closes GH-6185.

4 years agoConvert unpack offset warning to ValueError
Nikita Popov [Tue, 22 Sep 2020 12:00:48 +0000 (14:00 +0200)]
Convert unpack offset warning to ValueError

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Tue, 22 Sep 2020 11:19:06 +0000 (13:19 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix #79423: copy command is limited to size of file it can copy

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Tue, 22 Sep 2020 11:16:42 +0000 (13:16 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79423: copy command is limited to size of file it can copy

4 years agoFix #79423: copy command is limited to size of file it can copy
Christoph M. Becker [Wed, 9 Sep 2020 17:21:41 +0000 (19:21 +0200)]
Fix #79423: copy command is limited to size of file it can copy

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.

4 years agoUse C zpp for get_class_vars()
Nikita Popov [Tue, 22 Sep 2020 11:05:05 +0000 (13:05 +0200)]
Use C zpp for get_class_vars()

4 years agoSupport uuencoding empty string
Nikita Popov [Tue, 22 Sep 2020 10:39:39 +0000 (12:39 +0200)]
Support uuencoding empty string

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.

4 years agostream_bucket_new() cannot return false
Nikita Popov [Tue, 22 Sep 2020 10:07:53 +0000 (12:07 +0200)]
stream_bucket_new() cannot return false

php_stream_bucket_new() is infallible.

4 years agostream_get_transports/wrappers cannot return false
Nikita Popov [Tue, 22 Sep 2020 10:02:39 +0000 (12:02 +0200)]
stream_get_transports/wrappers cannot return false

These may return an empty array, but not false.

4 years agoDon't return false for empty string in soundex()
Nikita Popov [Tue, 22 Sep 2020 09:42:50 +0000 (11:42 +0200)]
Don't return false for empty string in soundex()

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.

4 years agoSkip if https wrapper isn't present
Levi Morrison [Tue, 22 Sep 2020 09:36:32 +0000 (03:36 -0600)]
Skip if https wrapper isn't present

4 years agohttp_build_query() cannot fail
Nikita Popov [Tue, 22 Sep 2020 09:30:02 +0000 (11:30 +0200)]
http_build_query() cannot fail

Assert that ht is not null and make php_url_encode_hash_ex() return
void to clarify that this is an infallible function.

4 years agohtml_entity_decode() cannot fail
Nikita Popov [Tue, 22 Sep 2020 09:23:01 +0000 (11:23 +0200)]
html_entity_decode() cannot fail

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.

4 years agoValidate phonemes parameter of metaphone()
Nikita Popov [Tue, 22 Sep 2020 09:19:02 +0000 (11:19 +0200)]
Validate phonemes parameter of metaphone()

And thus avoid the false return value.

4 years agosubstr_compare() cannot return false
Nikita Popov [Tue, 22 Sep 2020 08:54:44 +0000 (10:54 +0200)]
substr_compare() cannot return false

4 years agoCheck string bounds in strspn/strcspn
Nikita Popov [Tue, 22 Sep 2020 08:42:24 +0000 (10:42 +0200)]
Check string bounds in strspn/strcspn

strspn/strcspn are string search functions, and as such should throw
ValueError on out-of-bounds offsets, just like strpos etc do.

4 years agoPromote substr_replace warnings
Nikita Popov [Tue, 22 Sep 2020 08:22:43 +0000 (10:22 +0200)]
Promote substr_replace warnings

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.

4 years agosubstr_replace() cannot return false
Nikita Popov [Tue, 22 Sep 2020 07:59:25 +0000 (09:59 +0200)]
substr_replace() cannot return false

4 years agoFixed minor typo in comment
Ikko Ashimine [Tue, 22 Sep 2020 01:49:59 +0000 (10:49 +0900)]
Fixed minor typo in comment

Initiailize -> Initialize

Closes GH-6181.

4 years agoFixed INIT_METHOD_CALL + IS_VAR + reference in tracing JIT
Dmitry Stogov [Mon, 21 Sep 2020 21:47:23 +0000 (00:47 +0300)]
Fixed INIT_METHOD_CALL + IS_VAR + reference in tracing JIT

4 years agoFixed incorrect assumption about sizeof(zend_reference)
Dmitry Stogov [Mon, 21 Sep 2020 20:58:18 +0000 (23:58 +0300)]
Fixed incorrect assumption about sizeof(zend_reference)

4 years agoFiced 32-bit JIT (inconsistent CPU stack state)
Dmitry Stogov [Mon, 21 Sep 2020 20:43:31 +0000 (23:43 +0300)]
Ficed 32-bit JIT (inconsistent CPU stack state)

4 years agoPromote count() warning to TypeError
George Peter Banyard [Mon, 21 Sep 2020 16:01:40 +0000 (17:01 +0100)]
Promote count() warning to TypeError

Closes GH-6180

4 years agoFixed incorrect JIT for FETCH_THIS+SEND_REF
Dmitry Stogov [Mon, 21 Sep 2020 18:53:03 +0000 (21:53 +0300)]
Fixed incorrect JIT for FETCH_THIS+SEND_REF

4 years agoDrop -1 mode for collator_is_numeric()
George Peter Banyard [Mon, 21 Sep 2020 14:38:26 +0000 (15:38 +0100)]
Drop -1 mode for collator_is_numeric()

It is used only once with allow_errors enabled

4 years agoDrop Hex support in numeric strings for Intl collator
George Peter Banyard [Mon, 21 Sep 2020 14:33:23 +0000 (15:33 +0100)]
Drop Hex support in numeric strings for Intl collator

Support for this was removed in PHP 7.0.

See: https://wiki.php.net/rfc/remove_hex_support_in_numeric_strings

4 years agoReturn empty array for no rows in pg_fetch_all()
Nikita Popov [Mon, 21 Sep 2020 15:20:28 +0000 (17:20 +0200)]
Return empty array for no rows in pg_fetch_all()

This makes it line up with pg_fetch_all_columns(), as well as
similar functions in other exts, such as mysqli_fetch_all().

4 years agoThrow warning for failed object to int/float conversion
Nikita Popov [Mon, 21 Sep 2020 09:07:42 +0000 (11:07 +0200)]
Throw warning for failed object to int/float conversion

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.

4 years agoConvert exception instanceof checks to assertions
Nikita Popov [Mon, 21 Sep 2020 09:05:19 +0000 (11:05 +0200)]
Convert exception instanceof checks to assertions

4 years agoMake constant redeclaration a warning
Nikita Popov [Mon, 21 Sep 2020 09:02:09 +0000 (11:02 +0200)]
Make constant redeclaration a warning

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.

4 years agoPromote invalid field to ValueError in pgsql
Nikita Popov [Mon, 21 Sep 2020 14:11:50 +0000 (16:11 +0200)]
Promote invalid field to ValueError in pgsql

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.

4 years agoRemove redundant check
Nikita Popov [Mon, 21 Sep 2020 13:59:44 +0000 (15:59 +0200)]
Remove redundant check

This was already checked directly above.

4 years agoCheck linker compatibility directly from HMODULE
Christoph M. Becker [Wed, 5 Aug 2020 06:59:41 +0000 (08:59 +0200)]
Check linker compatibility directly from HMODULE

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.

4 years agoMerge branch 'PHP-7.4' into master
Christoph M. Becker [Mon, 21 Sep 2020 14:09:17 +0000 (16:09 +0200)]
Merge branch 'PHP-7.4' into master

* PHP-7.4:
  Fix mmap copying

4 years agoFix mmap copying
Christoph M. Becker [Mon, 21 Sep 2020 11:57:05 +0000 (13:57 +0200)]
Fix mmap copying

Instead of attempting to map large files into memory at once, we map
chunks of at most `PHP_STREAM_MMAP_MAX` bytes, and repeat that until we
hit the point where `php_stream_seek()` fails (see bug 54902), and copy
the rest of the file by reading and writing small chunks.

We also fix the mapping behavior for zero bytes on Windows, which did
not error (as with `mmap()`), but would have mapped the remaining file.

4 years agoFix a few Iterator signatures
Máté Kocsis [Mon, 21 Sep 2020 12:47:54 +0000 (14:47 +0200)]
Fix a few Iterator signatures

Closes GH-6176

4 years agoDrop some connection retries in IMAP test
George Peter Banyard [Mon, 21 Sep 2020 13:48:02 +0000 (14:48 +0100)]
Drop some connection retries in IMAP test

They are unnecessary and just take time for no good reason

4 years agopg_unescape_bytea() can only fail on OOM
Nikita Popov [Mon, 21 Sep 2020 13:46:55 +0000 (15:46 +0200)]
pg_unescape_bytea() can only fail on OOM

The implementation did not check for PQunescapeBytea failure
correctly, because it checked for a null pointer after estrndup,
which certainly cannot happen. Inspection of the PGunescapeBytea
implementation has shown that this function can only fail on OOM,
so let's check for that explicitly and remove false as a possible
return type.

While we're here, avoid an unnecessary copy of the result.

4 years agoPromote PDORow property write to Error
Nikita Popov [Mon, 21 Sep 2020 13:29:10 +0000 (15:29 +0200)]
Promote PDORow property write to Error

4 years agoRemove dead code
Nikita Popov [Mon, 21 Sep 2020 13:22:47 +0000 (15:22 +0200)]
Remove dead code

The "if ever" here is the relevant bit...

4 years agoPromote warnings to Error in COM extension
George Peter Banyard [Wed, 16 Sep 2020 00:03:46 +0000 (02:03 +0200)]
Promote warnings to Error in COM extension

Closes GH-6141

4 years agoSynchronize GET_CLASS/GET_CALLED_CLASS opcodes with functions
Nikita Popov [Mon, 21 Sep 2020 13:05:03 +0000 (15:05 +0200)]
Synchronize GET_CLASS/GET_CALLED_CLASS opcodes with functions

These error conditions throw in the function implementations,
make the opcodes match.

4 years agoAssert on unknown list entry type
Nikita Popov [Mon, 21 Sep 2020 12:58:23 +0000 (14:58 +0200)]
Assert on unknown list entry type

4 years agoRemove unnecessary check
Nikita Popov [Mon, 21 Sep 2020 12:56:14 +0000 (14:56 +0200)]
Remove unnecessary check

We should only produce IS_UNDEF if an exception is thrown, this
check is not needed.

4 years agoUse proper parameter type in Closure::bindTo() signature
Nikita Popov [Mon, 21 Sep 2020 12:45:31 +0000 (14:45 +0200)]
Use proper parameter type in Closure::bindTo() signature

4 years agoImprove default value handling of Exception constructors
Máté Kocsis [Sat, 19 Sep 2020 12:13:42 +0000 (14:13 +0200)]
Improve default value handling of Exception constructors

Closes GH-6166