Commit Graph

1305 Commits

Author SHA1 Message Date
David Carlier
33967aef11 ext/gettext: dcgettext/dcngettext fix for stable branches.
close GH-13594
2024-03-05 18:39:14 +00:00
David Carlier
9999a0cb75 ext/gettext: dcgettext/dcngettext sigabrt on macOs.
the man page states `the locale facet is determined by the category argument,  which  should  be
 one of the LC_xxx constants defined in the <locale.h> header, excluding LC_ALL`,
since the 0.22.5 release, sanity checks had been strenghtened leading to
an abort with the Zend/tests/arginfo_zpp_mismatch.phpt test setting the
category to 0 which is LC_ALL on macOs.

close GH-13555
2024-03-04 15:34:59 +00:00
Saki Takamachi
04e8e55f47
Added validation of \n in $additional_headers of mail()
When $additional_headers of mail() is an array, the same validation as
`\r\n` is now applied to `\n` alone too.
2024-03-04 21:30:07 +09:00
Alex Dowad
7cef7cb0ee Add more details in UPGRADING on mb_check_encoding changes 2023-04-10 19:47:03 +02:00
pakutoma
6fc8d014df Fix phpGH-10648: add check function pointer into mbfl_encoding
Previously, mbstring used the same logic for encoding validation as for
encoding conversion.

However, there are cases where we want to use different logic for validation
and conversion. For example, if a string ends up with missing input
required by the encoding, or if a character is input that is invalid
as an encoding but can be converted, the conversion should succeed and
the validation should fail.

To achieve this, a function pointer mb_check_fn has been added to
struct mbfl_encoding to implement the logic used for validation.
Also, added implementation of validation logic for UTF-7, UTF7-IMAP,
ISO-2022-JP and JIS.
2023-03-24 20:34:22 +02:00
Jakub Zelenka
cc931af35d
Fix GH-8086: Introduce mail.mixed_lf_and_crlf INI
When this INI option is enabled, it reverts the line separator for
headers and message to LF which was a non conformant behavior in PHP 7.
It is done because some non conformant MTAs fail to parse CRLF line
separator for headers and body.

This is used for mail and mb_send_mail functions.
2023-01-19 19:05:39 +00:00
Niels Dossche
4ea85d4044
Implement GMP::__construct()
Implements a proper constructor for GMP as discussed in both GH-10158 and https://externals.io/message/119216.
Fixes GH-10155

Closes GH-10225

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-19 14:13:34 +00:00
Tim Düsterhus
f2e8c5da90
unserialize: Strictly check for :{ at object start (#10214)
* unserialize: Strictly check for `:{` at object start

* unserialize: Update CVE tests

It's unlikely that the object syntax error contributed to the actual CVE. The
CVE is rather caused by the incorrect object serialization data of the `C`
format. Add a second string without such a syntax error to ensure that path is
still executed as well to ensure the CVE is absent.

* Fix test expectation in gmp/tests/bug74670.phpt

No changes to the input required, because the test actually is intended to
verify the behavior for a missing `}`, it's just that the report position changed.

* NEWS

* UPGRADING
2023-01-12 19:55:54 +01:00
George Peter Banyard
52a891aeaa
Add a new imap_is_open() function to check that a connection object is still valid 2022-12-13 23:48:03 +00:00
Jakub Zelenka
f33b35c2ec [ci skip] Fix formatting in PHP 8.2 UPGRADING 2022-11-23 10:48:16 +00:00
Jakub Zelenka
94702c56e0
Fix bug #80669: FPM numeric user fails to set groups 2022-11-23 10:38:56 +00:00
George Peter Banyard
a8d6ca4ef1
Fix UPGRADING by adding DBA constants 2022-09-30 12:48:54 +01:00
George Peter Banyard
0d19ae4068
Add support for binary and octal number prefixes for INI settings
Closes GH-9560
2022-09-30 11:56:39 +01:00
George Peter Banyard
85d10cc93d
Use true return type for XML functions which always return true
And fix xml_parser_set_option() which didn't return false on failure.

Closes GH-9539
2022-09-23 13:22:13 +01:00
Christoph M. Becker
853181a14d
Add NEWS and UPGRADING entries for GH-9296 2022-08-30 16:59:39 +02:00
Tim Starling
11796229f2
Add libxml_get_external_entity_loader()
Add libxml_get_external_entity_loader(), which returns the currently
installed external entity loader, i.e. the value which was passed to
libxml_set_external_entity_loader() or null if no loader was installed
and the default entity loader will be used.

This allows libraries to save and restore the loader, controlling entity
expansion without interfering with the rest of the application.

Add macro Z_PARAM_FUNC_OR_NULL_WITH_ZVAL(). This allows us to get the
zval for a callable parameter without duplicating callable argument
parsing.

The saved zval keeps the object needed for fcc/fci alive, simplifying
memory management.

Fixes #76763.
2022-08-28 12:47:20 +01:00
Jakub Zelenka
35e2a25d83
Add openssl_cipher_key_length function
This function works in exactly the same way as openssl_cipher_iv_length
but for a key length. This is especially useful to make sure that the
right key length is provided to openssl_encrypt and openssl_decrypt.

In addtion the change also updates implementation of
openssl_cipher_iv_length and adds a test for it.
2022-08-28 12:27:16 +01:00
Jakub Zelenka
39b2380c34
[ci skip] Add note about chacha20-poly1305 additon to UPGRADING 2022-08-28 12:26:37 +01:00
George Peter Banyard
66aed3a86f SameSite session cookie prop should behave like other INI settings
It should warn if the INI setting is changed after headers are sent or a session is not active
2022-08-22 16:09:46 +01:00
sji
038c451c22
[ci skip] NEWS and UPGRADING for constants in traits (#9251)
see GH-8888
2022-08-04 23:18:50 +02:00
Tim Düsterhus
3331832b04
Add ext/random Exception hierarchy (#9220)
* Add Random\Random{Error,Exception} and Random\BrokenRandomEngineError

* Throw BrokenRandomEngineError

* Throw RandomException on seeding failure

* Throw RandomException when CSPRNG fails

* Remove unused include from ext/random/engine_combinedlcg.c

* Remove unused include from ext/random/engine_secure.c

* Remove unused include from ext/random/random.c

* [ci skip] Add ext/random Exception hierarchy to NEWS

* [ci skip] Add the change of Exception for random_(int|bytes) to UPGRADING
2022-08-02 20:04:28 +02:00
Jakub Zelenka
e5ab9f45d5
Fix bug #65489: glob() basedir check is inconsistent
This removes the inconsistent and incorrectly working open basedir check
on pattern in glob. It means that an empty array will be returned even
if the whole pattern is outside the open basedir restriction.
2022-08-02 18:36:29 +01:00
Jakub Zelenka
1a9e6895f1
Fix #65069: GlobIterator incorrect handling of open_basedir check
This PR changes the glob stream wrapper so it impacts "glob://"
streamsas well. The idea is to do a check for each found path instead
of the pattern which was not working correctly.
2022-07-28 11:42:42 +01:00
Martin Herndl
229b189293
[ci skip] Fix str_split NEWS and UPGRADE note
Closes GH-9123.
2022-07-25 13:45:01 +02:00
George Peter Banyard
3c372901bd Add support to pass driver flags to DBA handlers
Currently only LMDB with DBA_LMDB_USE_SUB_DIR/DBA_LMDB_NO_SUB_DIR are supported
2022-07-23 18:38:27 +01:00
Tim Düsterhus
065e284f8e [ci skip] Link the random extension RFCs in UPGRADING
see 4d8dd8d258
2022-07-19 17:44:22 +02:00
Tim Düsterhus
7ae7df5b46
RFC: Make the iterator_*() family accept all iterables (#8819)
https://wiki.php.net/rfc/iterator_xyz_accept_array
2022-07-19 16:46:32 +02:00
dixyes
745cf34ffc
Port standard/crc32 for windows arm64
We also add arm64 support for php_get_windows_cpu().

Closes GH-7703.
2022-07-19 13:23:44 +02:00
Kamil Tekiela
079773c291
Merge branch 'IS_MARIADB'
* IS_MARIADB:
  Deprecate MYSQLI_IS_MARIADB
2022-07-19 11:21:26 +01:00
Kamil Tekiela
5a69cb6fa1
Deprecate MYSQLI_IS_MARIADB
Closes GH-8919
2022-07-19 11:19:41 +01:00
Go Kudo
4d8dd8d258
Implement Random Extension
https://wiki.php.net/rfc/rng_extension
https://wiki.php.net/rfc/random_extension_improvement
2022-07-19 10:27:38 +01:00
Ilija Tovilo
7aadbcb8f4
GH-8344 Fetch properties of enums in const expressions 2022-07-18 23:52:28 +02:00
root
d8fc05c05e
Add FILTER_FLAG_GLOBAL_RANGE to filter Global IPs as per RFC 6890 2022-07-18 17:56:05 +01:00
Mikhail Galanin
ffdf25a270
Add "error_log_mode" setting 2022-07-18 15:41:28 +01:00
Jakub Zelenka
0a4a55fd44
Allow to not close stream on rscr dtor in php cli sapi 2022-07-18 10:58:50 +01:00
Tim Düsterhus
332ac8ec25
[ci skip] Add DNF types to UPRADING (#9031)
see #8725
2022-07-17 12:43:55 +01:00
Rowan Tommins
af15923bc3
Extend deprecation notices to is_callable($foo) and callable $foo
Implements https://wiki.php.net/rfc/partially-supported-callables-expand-deprecation-notices
so that uses of "self" and "parent" in is_callable() and callable
type constraints now raise a deprecation notice, independent of the
one raised when and if the callable is actually invoked.

A new flag is added to the existing check_flags parameter of
zend_is_callable / zend_is_callable_ex, for use in internal calls
that would otherwise repeat the notice multiple times. In particular,
arguments to internal function calls are checked first based on
arginfo, and then again during ZPP, so the former suppresses the
deprecation notice.

Some existing tests which raised this deprecation have been updated
to avoid the syntax, but the existing version retained for maximum
regression coverage until it is made an error.

With thanks to Juliette Reinders Folmer for the RFC and initial
investigation.

Closes GH-8823.
2022-07-14 17:07:42 +02:00
Christoph M. Becker
56804e3221
Fix GH-8750: Can not create VT_ERROR variant type
We add support for creating `VT_ERROR` variants via `__construct()`,
and allow casting to int via `variant_cast()` and `variant_set_type()`.
We do not, however, allow type conversion by other means, to avoid
otherwise easily introduced type confusion.  VB(A) also only allows
explicit type conversion.

We also introduce `DISP_E_PARAMNOTFOUND` which might be the most
important `scode` for this purpose, since this allows to skip optional
parameters in method calls.

Closes GH-8886.
2022-07-12 16:43:14 +02:00
David Carlier
185d604d56 NEWS/UPGRADING changes 2022-07-10 21:30:08 +01:00
Arnaud Le Blanc
d217a669fc [ci skip] NEWS 2022-07-10 15:18:51 +02:00
Michael Voříšek
e80925445c Fix GH-8924 str_split of empty string must return empty array
Closes #8945.
2022-07-08 15:49:45 +01:00
Kamil Tekiela
012abcdb52
Update UPGRADING 2022-07-06 12:28:54 +01:00
Sebastian Bergmann
eb5b12c225
[ci skip] Fix typo 2022-07-03 07:16:53 +02:00
David Carlier
fdc09e302a Fix GH-8907: Document forgotten API changes.
binary safe string comparisons and recent socket option addition.

Closes #8910.
2022-07-02 20:42:39 +01:00
Remi Collet
63c7418b91
[ci skip] NEWS and UPGRADING 2022-06-28 15:19:56 +02:00
Ayesh Karunaratne
526af6ea67
[ci skip] Add true type support to UPGRADING file
Closes GH-8826.
2022-06-19 12:28:35 +02:00
tobil4sk
5bb3e233db
Implement #77726: Allow null character in regex patterns
In 8b3c1a3, this was disallowed to fix #55856, which was a security
issue caused by the /e modifier. The fix that was made was the
"Easier fix" as described in the original report.

With this fix, pattern strings are no longer treated as null terminated,
so null characters can be placed inside and matched against with regex
patterns without security problems, so there is no longer a reason to
give the error. Allowing this is consistent with the behaviour of many
other languages, including JavaScript, and thanks to PCRE2[0], it does
not require manually escaping null characters. Now that we can avoid the
error here without the cost of escaping characters, there is really no
need anymore to stray here from the conventional behaviour.

Currently, null characters are still disallowed before the first
delimiter and in the options section at the end of a regex string, but
these error messages have been updated.

[0] Since PCRE2, pattern strings no longer have to be null terminated,
and raw null characters match as normal.

Closes GH-8114.
2022-06-17 19:30:44 +02:00
Arnaud Le Blanc
efc8f0ebf8
Deprecate zend_atol() / add zend_ini_parse_quantity() (#7951)
Add zend_ini_parse_quantity() and deprecate zend_atol(), zend_atoi()

zend_atol() and zend_atoi() don't just do number parsing.
They also check for a 'K', 'M', or 'G' at the end of the string,
and multiply the parsed value out accordingly.

Unfortunately, they ignore any other non-numerics between the
numeric component and the last character in the string.
This means that numbers such as the following are both valid
and non-intuitive in their final output.

* "123KMG" is interpreted as "123G" -> 132070244352
* "123G " is interpreted as "123 " -> 123
* "123GB" is interpreted as "123B" -> 123
* "123 I like tacos." is also interpreted as "123." -> 123

Currently, in php-src these functions are used only for parsing ini values.

In this change we deprecate zend_atol(), zend_atoi(), and introduce a new
function with the same behavior, but with the ability to report invalid inputs
to the caller. The function's name also makes the behavior less unexpected:
zend_ini_parse_quantity().

Co-authored-by: Sara Golemon <pollita@php.net>
2022-06-17 14:12:53 +02:00
Pierrick Charron
b9af4335e3
Add new curl_upkeep() function 2022-06-13 18:15:21 -04:00
Pierrick Charron
cec20f615d
Expose new constants from libcurl 7.62 to 7.80 2022-06-13 18:15:21 -04:00