Commit Graph

1223 Commits

Author SHA1 Message Date
David Carlier
3414ae6c0c
sockets: add SO_INCOMING_CPU constant
get/set the cpu attached to a socket, no special treatment needed,
it is simply an integer.

Closes GH-7753.
2021-12-20 14:58:09 +01:00
Christoph M. Becker
30a3280df7
Oracle Client 10g is no longer supported
Thus, we drop respective config option for Windows.
2021-12-15 22:09:58 +01:00
Yannis Guyon
38460c2c94
Implement php_handle_avif() using libavifinfo
See #80828 and the internals@ mailing list discussion at
https://externals.io/message/116543

Use libavifinfo's AvifInfoGetFeaturesStream() in php_handle_avif() to
get the width, height, bit depth and channel count from an AVIF
payload. Implement stream reading/skipping functions and data struct.
Use libavifinfo's AvifInfoIdentifyStream() in php_is_image_avif().

Update the expected features read from "test1pix.avif" in
getimagesize.phpt.

Closes GH-7711.
2021-12-15 20:27:40 +01:00
Tim Starling
8eee0d6130
Make strtolower() and strtoupper() do ASCII case conversion (#7506)
Implement RFC https://wiki.php.net/rfc/strtolower-ascii
2021-12-15 08:38:35 -05:00
Christopher Jones
93f6af6913
It's past time to drop linking support for Oracle Client 10g 2021-12-12 13:58:04 +11:00
Christopher Jones
ac91b83ceb
Add oci_set_prefetch_lob() 2021-12-11 21:38:08 +11:00
Nikita Popov
902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00
Christopher Jones
9cd7f41fac
Add oci8.prefetch_lob_size 2021-11-12 17:59:22 +11:00
George Peter Banyard
7db32add9b
Refactor dba_(p)open() to be more sensible (#7610)
Actually use ZPP
Throw ValueErrors for invalid values
Use dedicated struc members for file permission and map size instead of a zval stack
2021-11-06 23:09:40 +00:00
DmitryMaksimov
2b32cafd88
Use neutral language instead of default on Windows
Most notably, this affects some Windows specific error messages, which
are no longer in the default language of the system, to better match
error messages provided by PHP which are not localized anyway.

This also affects the com_dotnet extension, where it could fix some
DCOM related issues.  Furthermore, the constant `LOCALE_NEUTRAL` is
added, which can be used for `variant_cmp()`.

Closes GH-7613.
2021-11-03 19:39:20 +01:00
Felipe Pena
e089a50f53 Add support for PCRE n modifier
Add support for /n (NO_AUTO_CAPTURE) modifier, which makes simple
`(xyz)` groups non-capturing.

Closes GH-7583.
2021-11-03 15:17:54 +01:00
Alex Dowad
9308974f8c Deprecate use of mbstring to convert text to Base64/QPrint/HTML entities/etc
The purpose of mbstring is for working with Unicode and legacy text
encodings; but Base64, QPrint, etc. are not text encodings and don't
really belong in mbstring. PHP already contains separate implementations
of Base64, QPrint, and HTML entities. It will be better to eventually
remove these non-encodings from mbstring.

Regarding HTML entities... there is a bit more to say. mbstring's
implementation of HTML entities is different from the other built-in
implementation (htmlspecialchars and htmlentities). Those functions
convert <, >, and & to HTML entities, but mbstring does not.

It appears that the original author of mbstring intended for something
to be done with <, >, and &. He used a table to identify which
characters should be converted to HTML entities, and </>/& all have a
special value in that table. However, nothing ever checks for that
special value, so the characters are passed through unconverted.

This seems like a very useless implementation of HTML entities. The most
important characters which need to be expressed as entities in HTML
documents are those three!
2021-11-01 11:23:21 +02:00
Sergey Panteleev
5e7e654514
Fix a method name ZipArchive::clearError typo
Closes GH-7616.
2021-10-27 13:02:10 +02:00
George Peter Banyard
e56c506020
Refactor DBA
Use proper ZPP union types
Use standard function signature semantics for dba_fetch()
Re-ordering of checks
2021-10-23 12:04:23 +01:00
Nikita Popov
ee510eed68 Deprecate partially supported callables
This deprecates all callables that are accepted by
call_user_func($callable) but not by $callable(). In particular:

    "self::method"
    "parent::method"
    "static::method"
    ["self", "method"]
    ["parent", "method"]
    ["static", "method"]
    ["Foo", "Bar::method"]
    [new Foo, "Bar::method"]

RFC: https://wiki.php.net/rfc/deprecate_partially_supported_callables

Closes GH-7446.
2021-10-22 10:15:24 +02:00
Ayesh Karunaratne
d23e36da81 Add CURLINFO_EFFECTIVE_METHOD
Since Curl 7.72.0, it supports a new parameter
called `CURLINFO_EFFECTIVE_METHOD`, which returns the effect method
in HTTP(s) requests. This is similar to `CURLINFO_EFFECTIVE_URL`.

 - https://curl.se/libcurl/c/CURLINFO_EFFECTIVE_METHOD.html

This adds support for CURLINFO_EFFECTIVE_URL if ext/curl is built
with libcurl >= 7.72.0 (0x074800).

Closes GH-7595.
2021-10-21 10:33:40 +02:00
Remi Collet
e9b96ae5da
Add ZipArchive::clearError, getStreamIndex and getStreamName methods
public function clearError(): void {}
    public function getStreamIndex(int $index, int $flags = 0) {}
    public function getStreamName(string $name, int $flags = 0) {}

ZipArchive::getStream is kept for BC

See https://github.com/pierrejoye/php_zip/issues/20
2021-10-11 15:39:35 +02:00
Nikita Popov
9d8f97d58d Revert "Fix DATE_FORMAT_COOKIE definition"
This reverts commit ac34648cf6.

As pointed out on GH-6783, the new format doesn't match any of
the specified formats. Previously the constant generated

    Thursday, 14-Jul-2005 22:30:41 BST

which is obsolete. Now it generates

    Thu, 14-Jul-2005 22:30:41 BST

which is not specified at all. The correct version would be:

    Thu, 14 Jul 2005 22:30:41 BST

Reverting the change for now.
2021-09-29 09:26:40 +02:00
Mahmood Dhia
ac34648cf6 Fix DATE_FORMAT_COOKIE definition
In all of http://curl.haxx.se/rfc/cookie_spec.html,
https://docs.microsoft.com/de-de/windows/win32/wininet/http-cookies
and https://tools.ietf.org/html/rfc7234#section-5.3 the cookie
datetime is specified as Mon, DD-Mon-YYYY HH:MM:SS GMT. However,
the current definition returns Monday, DD-Mon-YYY HH:MM:SS GMT.
Therefore, the "l" in "l, d-M-Y H:i:s T" must be changed to "D".

Closes GH-6783.
2021-09-23 16:01:04 +02:00
Patrick Allaert
1c33ddb5e5
Prepare for PHP 8.2 2021-08-31 19:13:49 +02:00
Nikita Popov
a968055b77 Add UPGRADING for ini parser changes
Missed the "git add" once again...

[ci skip]
2021-08-31 10:09:34 +02:00
Nikita Popov
7b34db0659 Switch default PKCS7/CMS cipher to AES-128-CBC
Switch default cipher for openssl_pkcs7_encrypt() and
openssl_cms_encrypt() from RC2-40 to AES-128-CBC.

The RC2-40 cipher is considered insecure and is not loaded by
default in OpenSSL 3, which means that these functions will
always fail with default arguments.

As the used algorithm is embedded in the result (which makes this
different from the openssl_encrypt() case) changing the default
algorithm should be safe.

Closes GH-7357.
2021-08-16 12:31:48 +02:00
Ben Morss
eb6c9eb936
Lossless conversion for webp
Propagating lossless conversion from libgd to our bundled gd.
Changing "quantization" to "quality" as in libgd.
Adding test.

IMG_WEBP_LOSSLESS is only defined, if lossless WebP encoding is
supported by the libgd used.

Closes GH-7348.
2021-08-12 23:19:13 +02:00
Remi Collet
1100a079ed
NEWS 2021-08-11 14:21:18 +02:00
Remi Collet
5d57d9073c
NEWS 2021-08-11 13:04:23 +02:00
Nikita Popov
f2d3e75933 Do not special case export of EC keys
All other private keys are exported in PKCS#8 format, while EC
keys use traditional format. Switch them to use PKCS#8 format as
well.

As the OpenSSL docs say:

> PEM_write_bio_PrivateKey_traditional() writes out a private key
> in the "traditional" format with a simple private key marker and
> should only be used for compatibility with legacy programs.
2021-08-06 11:25:44 +02:00
Christoph M. Becker
ff8e04ac30
[ci skip] UPGRADING: oci8.old_oci_close_semantics has been deprecated 2021-07-25 14:51:15 +02:00
Nikita Popov
6780aaa532 Implement readonly properties
Add support for readonly properties, for which only a single
initializing assignment from the declaring scope is allowed.

RFC: https://wiki.php.net/rfc/readonly_properties_v2

Closes GH-7089.
2021-07-20 12:05:46 +02:00
Kamil Tekiela
052af90b86 Deprecate autovivification on false
Deprecate automatically converting "false" into an empty array
on write operands. Autovivification continues to be supported
for "null" values, as well as undefined/uninitialized values.

RFC: https://wiki.php.net/rfc/autovivification_false

Closes GH-7131.

Co-authored-by: Tyson Andre <tysonandre775@hotmail.com>
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-07-19 14:49:37 +02:00
George Peter Banyard
453a5163ce [skip-ci] Fixup UPGRADING documents
Some entries were in the wrong section/wrong document.
2021-07-17 23:27:26 +02:00
Nikita Popov
edb6b375dd Don't return bool from Phar::offsetUnset()
This violates the ArrayAccess interface. Use offsetExists() to
check if an entry exists.
2021-07-16 16:39:27 +02:00
Nikita Popov
172f84bfe4 Add UPGRADING entry for socket options
[ci skip]
2021-07-16 12:21:21 +02:00
George Peter Banyard
0ba155cd57 Make syslog() binary safe
Closes GH-7245

Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2021-07-15 19:08:26 +02:00
Nikita Popov
53aed48e5d Allow objects in define()
This was separately discussed in https://externals.io/message/114863,
but also necessary for consistency now that
https://wiki.php.net/rfc/new_in_initializers has landed.

Closes GH-7149.
2021-07-15 10:09:56 +02:00
Joe Watkins
d0b09a7be4 Add first-class callables
Support acquiring a Closure to a callable using the syntax
func(...), $obj->method(...), etc. This is essentially a
shortcut for Closure::fromCallable().

RFC: https://wiki.php.net/rfc/first_class_callable_syntax

Closes GH-7019.

Co-Authored-By: Nikita Popov <nikita.ppv@gmail.com>
2021-07-14 14:37:25 +02:00
Christoph M. Becker
e1285c4aa5
Deprecate $num_points parameter of image(open|filled)polygon
Cf. <https://wiki.php.net/rfc/deprecations_php_8_1#num_points_parameter_of_image_open_filled_polygon>.

Co-authored-by: Máté Kocsis <kocsismate@woohoolabs.com>
Co-authored-by: George Peter Banyard <7906688+Girgias@users.noreply.github.com>

Closes GH-6789.
2021-07-14 10:56:24 +02:00
Nikita Popov
4b3615a33f Deprecate strftime() and gmstrftime()
These are deprecated in favor of date()/DateTime::format() (for
locale-indendent formatting) and IntlDateFormatter::format()
(for locale-dependent formatting).

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-14 09:38:43 +02:00
Nikita Popov
9491694903 Deprecate SoapClient ssl_method option
Instead use ssl stream context options instead. The direct
equivalent would be crypto_method, but min_proto_version /
max_proto_version are recommended instead.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-14 09:36:26 +02:00
Nikita Popov
52d3d0d8d7 Add limited support for new in initializers
Add support for new expressions inside parameter default values,
static variable initializers, global constant initializers and
attribute arguments.

RFC: https://wiki.php.net/rfc/new_in_initializers

Closes GH-7153.
2021-07-13 14:03:20 +02:00
Nikita Popov
aa733e8ac8 Deprecate filter.default
There's a subtlety here regarding filter.default_flags. The RFC
stated that no separate deprecation warning will be emitted for
it, on the premise that it is only meaningful if filter.default
is set. However, it turns out that even FILTER_UNSAFE_RAW (which
is the "no-op filter") can be combined with stripping flags.
However, this is compensated by the fact that this doesn't actually
work when setting filter.default=unsafe_raw and non-default
filter.default_flags -- the flags are simply ignored in that case.
So everything works out in the end.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-12 09:33:08 +02:00
George Peter Banyard
1f42777927 Deprecate using the implicit default PgSQL connection
The DB connection should be provided in all cases as the first argument.
The overloaded function signatures will be removed in the future.
Warn about this change.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 23:12:37 +02:00
Nikita Popov
a80360dbed Deprecate direct access to static trait members
Static trait members may only be accessed through a class in which
the trait is used, not directly on the trait.

A complication here is that we should not store static
methods/properties for which a deprecation is triggered in a
cache slot. As the check for this is simple and cheap, I'm handling
this in the cache slot population code in the VM. The alternative
would be to pass the cache slot down into the fetching code.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 14:12:28 +02:00
Nikita Popov
08069165aa Deprecate ctype_*() on non-string arguments
Non-string arguments will be interpreted as strings in the future.
Warn about the upcoming behavior change.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 12:00:35 +02:00
Nikita Popov
232aa34b9f Deprecate auto_detect_line_endings
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 10:05:57 +02:00
Nikita Popov
bed7139375 Deprecate strptime()
Use date_parse_from_format() or IntlDateFormatter::parse() instead.

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-09 10:03:45 +02:00
Nikita Popov
2bc23cc6e3 Deprecate imap NIL constant
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:48:16 +02:00
Nikita Popov
f0b190c32d Deprecate return by ref from void function
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:47:37 +02:00
Nikita Popov
bf94010b4b Deprecate FILTER_SANITIZE_STRING/STRIPPED
Deprecate the FILTER_SANITIZE_STRING and FILTER_SANITIZE_STRIPPED
filters.

This is part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:46:59 +02:00
Nikita Popov
1c07b11b1c Deprecate odbc_result_all()
Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:46:08 +02:00
Nikita Popov
625b89af2f Deprecate mysqli::init()
In favor of parent::__construct().

Part of https://wiki.php.net/rfc/deprecations_php_8_1.
2021-07-08 16:45:05 +02:00