1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

2622 Commits

Author SHA1 Message Date
Alex Dowad
e106d688c2 Merge branch 'PHP-8.4' into PHP-8.5 2026-02-17 06:48:37 +09:00
Jordi Kroon
37c5a13d67 replace alloca with do_alloca in mb_guess_encoding_for_strings
This avoids a crash in cases where the list of candidate encodings is so huge
that alloca would fail. Such crashes have been observed when the list of
encodings was larger than around 208,000 entries.
2026-02-17 06:46:42 +09:00
Ilija Tovilo
9e96c5ff39 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Tweak zend.max_allowed_stack_size for gh20836_stack_limit.phpt
2026-02-03 00:54:56 +01:00
Ilija Tovilo
1f57d04648 Tweak zend.max_allowed_stack_size for gh20836_stack_limit.phpt
Fixes GH-21086
2026-02-03 00:54:25 +01:00
Alexandre Daubois
32803687fe Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20836: Stack overflow in mb_convert_variables with recursive array references (#20839)
2026-01-14 20:10:30 +01:00
Alexandre Daubois
2c112e3696 Fix GH-20836: Stack overflow in mb_convert_variables with recursive array references (#20839) 2026-01-14 20:07:11 +01:00
Niels Dossche
171b52c98f Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20833: mb_str_pad() divide by zero if padding string is invalid in the encoding
2026-01-05 20:01:54 +01:00
Niels Dossche
03113b09ce Fix GH-20833: mb_str_pad() divide by zero if padding string is invalid in the encoding
If the padding string is not valid in the given encoding,
mb_get_strlen() can return 0.

Closes GH-20834.
2026-01-05 20:01:25 +01:00
Yuya Hamada
64dd933a06 Merge branch 'PHP-8.4' into PHP-8.5 2025-12-15 10:58:49 +09:00
Yuya Hamada
355a4b5e61 Merge branch 'PHP-8.3' into PHP-8.4 2025-12-15 10:57:21 +09:00
Yuya Hamada
0056d013bf Fix GH-20674 mb_decode_mimeheader does not handle separator
`?=  =?` is skipped if long term, so skip space character.
Add test case from RFC2047 and fix last pattern
See: https://www.ietf.org/rfc/rfc2047#section-8
2025-12-15 10:55:17 +09:00
Niels Dossche
929e7177f1 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20492: mbstring compile warning due to non-strings
  Fix GH-20491: SLES15 compile error with mbstring oniguruma
2025-11-20 19:26:48 +01:00
Niels Dossche
10ac41f158 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-20492: mbstring compile warning due to non-strings
  Fix GH-20491: SLES15 compile error with mbstring oniguruma
2025-11-20 19:23:36 +01:00
Niels Dossche
159ef1401c Fix GH-20492: mbstring compile warning due to non-strings
This is a partial backport of ea69276f, but without changing public
headers as that's not allowed at this point.

Closes GH-20494.
2025-11-20 19:17:55 +01:00
Niels Dossche
a1912e3cdd Fix GH-20491: SLES15 compile error with mbstring oniguruma
The issue is specific to SLES15.
Arguably this should be reported to them as it seems to me they meddled
with the oniguruma source code.

The definition in oniguruma.h on that platform looks like this (same as upstream):
```c
ONIG_EXTERN
int onig_error_code_to_str PV_((OnigUChar* s, int err_code, ...));
```

Where `PV_` is defined as (differs):
```c
#ifndef PV_
#ifdef HAVE_STDARG_PROTOTYPES
# define PV_(args) args
#else
# define PV_(args) ()
#endif
#endif
```

So that means that `HAVE_STDARG_PROTOTYPES` is unset.
This can be set if we define `HAVE_STDARG_H`,
which we can do because PHP requires at least C99 in which the header
is always available.
We could also use an autoconf check, but this isn't really necessary as
it will always succeed.
2025-11-20 19:17:17 +01:00
Gina Peter Banyard
93676a0425 ext/standard: Deprecate passing string which are not one byte long to ord() (#19440)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_passing_string_which_are_not_one_byte_long_to_ord

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2025-09-14 11:42:59 +01:00
tekimen
edc2671227 ext/mbstring: Update to Unicode 17.0 (#19796)
Updates UCD to Unicode 17.0 (released 2025 Sep).
2025-09-13 08:07:51 +09:00
Jorg Adam Sowa
1e02099e6a ext/mbstring: Use internal_encoding INI setting instead of mb_internal_encoding() in tests (#19663)
Moves the usage of `mb_internal_encoding()` to INI section for the tests not testing the encoding/function itself, but the other mbstring/iconv functions.
2025-09-03 11:34:12 +01:00
Niels Dossche
be2889411a Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-19397: mb_list_encodings() can cause crashes on shutdown
2025-08-08 20:33:00 +02:00
Niels Dossche
db3f6d0bf0 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-19397: mb_list_encodings() can cause crashes on shutdown
2025-08-08 20:32:55 +02:00
Niels Dossche
cc93bbb765 Fix GH-19397: mb_list_encodings() can cause crashes on shutdown
The request shutdown does not necessarily hold the last reference, if
there is still a CV that refers to the array.

Closes GH-19405.
2025-08-08 20:32:29 +02:00
Gina Peter Banyard
105c1e9896 tree: use zend_str_has_nul_byte() API (#19336) 2025-07-31 23:57:27 +01:00
Niels Dossche
719419a6e5 Fix unterminated string GCC warnings in mbstring (#19192)
Necessary for for Werror builds
2025-07-23 11:49:16 +02:00
DanielEScherzer
07f1cfd9b0 Deprecate producing output in a user output handler (#19067)
https://wiki.php.net/rfc/deprecations_php_8_4
2025-07-09 21:20:58 -07:00
Gina Peter Banyard
c7778641dd ext/mbstring: Remove ZPP tests 2025-06-23 13:58:31 +02:00
Niels Dossche
b727821c79 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-18901: integer overflow mb_split
2025-06-22 13:09:09 +02:00
Niels Dossche
2577e3a703 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-18901: integer overflow mb_split
2025-06-22 13:08:05 +02:00
Niels Dossche
a5f21ca700 Fix GH-18901: integer overflow mb_split
We prevent signed overflow by making the count unsigned. The actual
interpretation of the count doesn't matter as it's just used to denote a
limit.

The test output for some limit values looks strange though, so that may
need extra investigation. However, that's orthogonal to this fix.

Closes GH-18906.
2025-06-22 13:07:43 +02:00
Niels Dossche
be17e9ed54 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix handling of references in zval_try_get_long()
2025-06-04 21:00:22 +02:00
Niels Dossche
2b383848a7 Fix handling of references in zval_try_get_long()
This API can't handle references, yet everyone keeps forgetting that it
can't and that you should DEREF upfront. Fix every type of this issue
once and for all by moving the reference handling to this Zend API.

Closes GH-18761.
2025-06-04 21:00:05 +02:00
Saki Takamachi
462fd4dffe Small change SIMD codes (#18626)
* use zend_simd.h in zend_accelerator_util_funcs.c

* use zend_simd.h in mbstring

* Remove unnecessary SSE3 includes
2025-05-26 16:32:27 +09:00
David CARLIER
16e154a2c4 ext/mbstring: mb_ereg*_replace remove unreachable code. (#18646) 2025-05-25 10:44:59 +01:00
Niels Dossche
cd43536b27 Drop useless cast 2025-05-21 19:54:09 +02:00
Niels Dossche
33ae76405f Use zend_string for arg_separators
This allows us to avoid a call to `zend_ini_str` which took 6% of the
profile on my i7-4790 for a call to `http_build_query`. Now we can just
grab the value from the globals.
In other files this can avoid some length recomputations.
2025-05-21 19:54:09 +02:00
Peter Kokot
8622362394 Remove unused strcasecmp definition (#17050)
The strcasecmp usage was removed via
dc5f3b9562.
2025-03-21 18:30:22 +01:00
Niels Dossche
33c4ca36e4 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix weird unpack behaviour in DOM
  Fix GH-17989: mb_output_handler crash with unset http_output_conv_mimetypes
2025-03-09 11:21:34 +01:00
Niels Dossche
aa6e58f82a Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix weird unpack behaviour in DOM
  Fix GH-17989: mb_output_handler crash with unset http_output_conv_mimetypes
2025-03-09 11:21:27 +01:00
Niels Dossche
c7d3dc6fab Fix GH-17989: mb_output_handler crash with unset http_output_conv_mimetypes
The INI option can be NULL or invalid, resulting in a NULL global.
So we have to add a NULL check.

Closes GH-17996.
2025-03-09 11:16:33 +01:00
Niels Dossche
b1841fdfa2 Avoid unnecessary string refcounting in ext/mbstring (#17892) 2025-02-23 00:23:53 +01:00
Christoph M. Becker
61f42f2d4e Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17503: Undefined float conversion in mb_convert_variables
2025-02-04 15:55:06 +01:00
Christoph M. Becker
47a0922dee Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17503: Undefined float conversion in mb_convert_variables
2025-02-04 15:53:24 +01:00
Christoph M. Becker
55e676e181 Fix GH-17503: Undefined float conversion in mb_convert_variables
Conversion of floating point to integer values is undefined if the
integral part of the float value cannot be represented by the integer
type.  We need to cater to that explicitly (in a manner similar to
`zend_dval_to_lval_cap()`).

Closes GH-17689.
2025-02-04 15:51:48 +01:00
Christoph M. Becker
36b8a69009 Drop superfluous enum forward declaration (GH-17455)
Besides that it is not needed, it is not proper C, and Clang warns that
"forward references to 'enum' types are a Microsoft extension"
(`-Wmicrosoft-enum-forward-reference`).
2025-01-17 11:45:58 +01:00
Niels Dossche
44a2a5d3e9 Merge branch 'PHP-8.4'
* PHP-8.4:
  Resolve GH-17112 for lower branches
2024-12-11 19:33:03 +01:00
Niels Dossche
ab47c189f3 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Resolve GH-17112 for lower branches
2024-12-11 19:32:48 +01:00
Niels Dossche
754aa7706b Resolve GH-17112 for lower branches
See https://github.com/php/php-src/pull/17114#issuecomment-2533050450
2024-12-11 19:32:36 +01:00
Niels Dossche
75e7234f70 Drop redundant macro definitions from mbfl_defs.h
These are defined by the standard include headers we already use.
These cause conflicts which cause compiler warnings on some toolchains
(see GH-17112).

Closes GH-17114.
2024-12-11 19:22:32 +01:00
Christoph M. Becker
6e759e079f Resolve some MSVC C4244 level 2 warnings
These got already approval by the respective code owners in GH-17076.
2024-12-11 00:12:13 +01:00
David Carlier
f47a45ecff Merge branch 'PHP-8.3' into PHP-8.4 2024-10-11 08:49:00 +01:00
David Carlier
89b4f94024 Merge branch 'PHP-8.2' into PHP-8.3 2024-10-11 08:48:49 +01:00