Commit Graph

1109 Commits

Author SHA1 Message Date
Nikita Popov
090627048c Revert "Remove no longer used "log_errors_max_len" ini directive (#6838)"
This reverts commit d2d227e547.

This is an ABI break.
2021-05-08 20:54:53 +02:00
Ben Ramsey
c2b5284734
Add entries for log_errors_max_len INI directive removal 2021-05-08 13:35:35 -05:00
Christoph M. Becker
2e854791af [ci skip] Fix pgsql constant names in UPGRADING 2020-12-31 00:30:16 +01:00
Christoph M. Becker
f1d11c118d 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.
2020-11-30 16:03:37 +01:00
George Peter Banyard
a55402d07c Rename XmlParser to XMLParser for consistency with XMLWriter/XMLReader 2020-11-30 14:08:31 +00:00
Nikita Popov
306555e11d Add UPGRADING note for PDO::inTransaction()
[ci skip]
2020-11-25 17:28:23 +01:00
Florian Engelhardt
cdd5ec7a3c [ci skip] Fix misspelled method names
Closes GH-6452.
2020-11-24 18:18:40 +01:00
jrfnl
860f46e2f5 UPGRADING: (real) cast has been removed
.. but the removal wasn't mentioned in the `UPGRADING` docs yet.

Ref:
* https://github.com/php/php-src/pull/5220
* c9db32271a

Closes GH-6440.

[ci-skip]
2020-11-20 16:48:32 +01:00
Pavel Djundik
7bbed18086 [ci skip] Add note that imagedestroy() no longer has an effect
Closes GH-6427.
2020-11-14 15:18:20 +01:00
Chris Brown
4d16d3cc38 Fix typo in UPGRADING
Closes GH-6395.
2020-11-03 09:35:02 +01:00
Chris Brown
94938e4ee7 [ci skip] Fix small typo
`as` -> `was`

Closes GH-6394.
2020-11-02 18:11:13 +01:00
Dmitry Stogov
2693f799be Don't force rebuild of symbol table, when populating $http_response_header variable by the HTTP stream wrapper 2020-10-28 12:59:00 +03:00
Nikita Popov
d776d25a8e Don't throw for out of bounds offsets in strspn()
Make strspn($str1, $str2, $offset, $length) behaviorally
equivalent to strspn(substr($str1, $offset, $length), $str2)
by not throwing for out of bounds offset.

There have been two reports that this change cause issues,
including bug #80285.
2020-10-27 11:42:01 +01:00
Thiemo Kreuz
9c28dc0ce9 Document breaking change in strspn/strcspn
See https://phabricator.wikimedia.org/T264502.

[ci skip]
2020-10-26 08:58:51 +01:00
Christoph M. Becker
fab76e3a11 [ci skip] Fix typos in UPGRADING 2020-10-25 16:27:20 +01:00
Nikita Popov
c97da0f819 Revert "Fix bug #64865: Use CONTEXT_DOCUMENT_ROOT for scanning dir tree"
This reverts commit 98bfad738a.

This doesn't work well in some setups, see bug #80113 and GH-5051.
Reverting this for now.
2020-10-19 11:23:00 +02:00
Anatoly Pashin
6669426ab9 [ci skip] Make it clear what GD uses instead of resources
Closes GH-6342.
2020-10-16 12:16:12 +02:00
Máté Kocsis
d6264b0966
Verify parameter names of function aliases
Closes GH-6335
2020-10-16 10:56:33 +02:00
Nikita Popov
5582490bf2 Normalize mb_ereg() return value
mb_ereg()/mb_eregi() currently have an inconsistent return value
based on whether the $matches parameter is passed or not:

> Returns the byte length of the matched string if a match for
> pattern was found in string, or FALSE if no matches were found
> or an error occurred.
>
> If the optional parameter regs was not passed or the length of
> the matched string is 0, this function returns 1.

Coupling this behavior to the $matches parameter doesn't make sense
-- we know the match length either way, there is no technical
reason to distinguish them. However, returning the match length
is not particularly useful either, especially due to the need to
convert 0-length into 1-length to satisfy "truthy" checks. We
could always return 1, which would kind of match the behavior of
preg_match() -- however, preg_match() actually returns the number
of matches, which is 0 or 1 for preg_match(), while false signals
an error. However, mb_ereg() returns false both for no match and
for an error. This would result in an odd 1|false return value.

The patch canonicalizes mb_ereg() to always return a boolean,
where true indicates a match and false indicates no match or error.
This also matches the behavior of the mb_ereg_match() and
mb_ereg_search() functions.

This fixes the default value integrity violation in PHP 8.

Closes GH-6331.
2020-10-13 20:40:55 +02:00
Christoph M. Becker
fbf221cac4 XMLReader::open() and XMLReader::xml() are now static 2020-10-11 18:50:35 +02:00
Remi Collet
107962208a add note about is_callable change 2020-10-03 07:27:08 +02:00
Nikita Popov
d7243ce291 Add UPGRADING note for substr() behavior
[ci skip]
2020-10-02 09:41:05 +02:00
Côme Chilliet
550a4f2fa8 Remove deprecated functions from php-ldap
Remove ldap_control_paged_result and ldap_control_paged_result_response
 which have been deprecated in PHP 7.4, in favor of new $controls
 parameters for ldap request functions.
2020-10-01 10:15:27 +02:00
Remi Collet
e39ce172f8 bump zip extension version 2020-09-29 16:17:23 +02:00
Christoph M. Becker
47a166c837 Fix #78792: zlib.output_compression disabled by Content-Type: image/
Disabling output compression for images has served to fix bug #16109,
where zlib compressed images apparently have caused issues with
Navigator 4.  This shouldn't be an issue with somewhat contemporary
browsers.  Other than that, this is an arbitrary restriction – why
don't we disable the compression for some other media types as well
(e.g. video/* and audio/*)?  All in all, we should leave that decision
to userland.

Closes GH-6198.
2020-09-29 11:30:06 +02:00
Christoph M. Becker
9f5a77188c Fix #22986: odbc_connect() may reuse persistent connection
`odbc_connect()` should not reuse persistent connections, since that
prohibits multiple concurrent connections, which are occasionally
desireable.  We fix that by no longer looking for already cached
connections when `odbc_connect()` is called, and instead creating a new
connection instead.

Closes GH-6223.
2020-09-29 11:20:41 +02:00
zeriyoshi
060fde4377 Add call_user_func_array() backward incompatible change
Closes GH-6218.

[ci skip]
2020-09-29 10:44:57 +02:00
Máté Kocsis
9b50fd2626
Fix UNKNOWN default values in ext/odbc
Closes GH-6154
2020-09-24 22:17:04 +02:00
Alex Dowad
4222ae16e7 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!
2020-09-23 08:33:24 +02:00
George Peter Banyard
5d7d5e2773 Add proper default values for optional arguments in IMAP
Closes GH-6179
2020-09-22 17:46:28 +01:00
Nikita Popov
8ff2f2f84b 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().
2020-09-21 17:22:02 +02:00
Nikita Popov
7300f6fc17 Deprecate pgsql function aliases
These have been documentation-deprecated for a very long time,
make it official.
2020-09-21 11:33:05 +02:00
Nikita Popov
5cb8b04646 Drop support for libmysqlclient < 5.5
Given how little maintenance the libmysqlclient driver sees, be
more aggressive in dropping old version support here.
2020-09-17 12:05:30 +02:00
Máté Kocsis
46d22e435f
Change int parameter types to bool when the parameter behaves as bool
Closes GH-6148
2020-09-17 09:38:18 +02:00
Nikita Popov
9a6c22da70 Remove deprecated pgsql signatures
As the comment indicates, these are deprecated in PHP 4.2...
2020-09-09 15:50:30 +02:00
Nikita Popov
3ab88831ae Remove deprecated multi-parameter form of pg_connect() 2020-09-09 12:31:00 +02:00
Nikita Popov
73ab7b30ca Allow array_diff() and array_intersect() with single array argument
Both of these functions are well-defined when used with a single
array argument -- rejecting this case was an artificial limitation.
This is not useful when called with explicit arguments, but removes
edge-cases when used with argument unpacking:

    // OK even if $excludes is empty.
    array_diff($array, ...$excludes);

    // OK even if $arrays contains a single array only.
    array_intersect(...$arrays);

This matches the behavior of functions like array_merge() and
array_push(), which also allow calls with no array or a single
array respectively.

Closes GH-6097.
2020-09-09 11:03:17 +02:00
Máté Kocsis
9975986b7e
Improve error messages mentioning parameters instead of arguments
Closes GH-5999
2020-09-09 10:47:43 +02:00
Nikita Popov
3e14942756 Require $method parameter in openssl_seal/openssl_open
RC4 is considered insecure, and it's not possible to change the
default of these functions. As such, require the method to be
passed explicitly.

Closes GH-6093.
2020-09-08 14:21:01 +02:00
Nikita Popov
032f862133 Drop support for crypt() without explicit salt
crypt() without salt generates a weak $1$ MD5 hash. It has been
throwing a notice since 2013 and we provide a much better alternative
in password_hash() (which can auto-generate salts for strong
password hashes), so keeping this is just a liability.
2020-09-07 15:43:26 +02:00
Benjamin Eberlei
842be67b60 Update NEWS, UPGRADING 2020-09-02 20:32:52 +02:00
Christoph M. Becker
e6044d4455 Fix #55847: DOTNET .NET 4.0 GAC new location
If we do not specify the exact version of the .NET framework to use,
the default CLR is loaded, which is typically CLR 2, which is very old.
Therefore, we introduce a `PHP_INI_SYSTEM` setting, which allows users
to choose the desired .NET framework version.  The value of the setting
are the first three parts of the framework's version number, separated
by dots, and prefixed with "v", e.g. "v4.0.30319".  If the value of the
INI setting is `NULL` (the default) or an empty string, the default CLR
is used.

Internally, we switch from the most generic `CoCreateInstance()` to
`CorBindToRuntime()` which is implemented in mscoree.dll.  To avoid the
hard dependency to that library, we load dynamically.

So this fix is supposed to be fully backwards compatible.

Closes GH-5949
2020-08-22 12:42:34 +02:00
Christopher Jones
ff66e4945e OCI8 classes were already renamed in 8; this now follows the new-new standard 2020-08-21 17:46:16 +10:00
Tyson Andre
9883fec99f Fix more basic function stubs
User-defined functions can't have multiple parameters with the same name.
Don't do that for var_dump/debug_zval_dump.

Consistently use array $array to match docs

Fix typo in UPGRADING

Fixes GH-6015
2020-08-18 20:23:42 -04:00
Christoph M. Becker
4514afc187 Fix #79988: new reserved keyword match is a backward incompatible change 2020-08-18 12:39:18 +02:00
Nikita Popov
e81ad4089e Expand upgrading note for namespaced name change
Mention the case from bug #79942.

[ci skip]
2020-08-10 11:20:07 +02:00
Nikita Popov
0d836a39a7 Revert "Prepare for PHP 8.1"
This reverts commit 1ab4d0e6b7.
This reverts commit a359635cb1.
2020-08-04 22:24:44 +02:00
Gabriel Caruso
a359635cb1
Prepare for PHP 8.1 2020-08-04 18:46:14 +02:00
Máté Kocsis
71bfa5344a
Add upgrading note for the resource to object migration in ext/sockets 2020-08-03 23:41:00 +02:00
Theodore Brown
e2b4687403 Minor grammar/consistency fixes in upgrade guide
[ci skip]
2020-08-03 15:34:10 -06:00