Commit graph

140337 commits

Author SHA1 Message Date
Christoph M. Becker
dd66bb9817
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix curl_basic_022.phpt for libcurl 8.12.0
2025-02-05 19:24:37 +01:00
Christoph M. Becker
e9d4fc184d
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix curl_basic_022.phpt for libcurl 8.12.0
2025-02-05 19:23:52 +01:00
Christoph M. Becker
47931a426e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix curl_basic_022.phpt for libcurl 8.12.0
2025-02-05 19:22:51 +01:00
Christoph M. Becker
856866ef24
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix curl_basic_022.phpt for libcurl 8.12.0
2025-02-05 19:22:20 +01:00
Christoph M. Becker
36d46a4732
Fix curl_basic_022.phpt for libcurl 8.12.0
Due to a deliberate change in libcurl, the expiration is now capped to
at most 400 days.  We could solve this by choosing another date roughly
a year in the future, but would need to update the test next year.
This would be especially annoying for security branches.

Another option would be to actually parse the cookie list lines, but
that might not be worth the trouble.  Instead we just ignore the exact
timestamp created by libcurl.

[1] <https://github.com/curl/curl/pull/15937>

Closes GH-17709.
2025-02-05 19:20:47 +01:00
Ilija Tovilo
4172b60818
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix segfault when assigning to backing value by-ref from hook
2025-02-05 18:06:41 +01:00
Ilija Tovilo
ab6977d36c
Fix segfault when assigning to backing value by-ref from hook
Fixes oss-fuzz #391975641
Closes GH-17620
2025-02-05 18:06:05 +01:00
Tim Düsterhus
e3798c2ab9
sapi/cli: Extend --ini to print INI settings changed from the builtin default (#17459)
* sapi/cli: Extend `--ini` to print INI settings changed from the builtin default

This is intended to make it easier to check whether or not a given INI setting
is changed from the default when building reproducers for a bugreport, without
forgetting any that might be relevant to the report.

As an example, running `sapi/cli/php -c /etc/php/8.3/cli/ --ini` on my Ubuntu
will now output:

    Configuration File (php.ini) Path: /usr/local/lib
    Loaded Configuration File:         /etc/php/8.3/cli/php.ini
    Scan for additional .ini files in: (none)
    Additional .ini files parsed:      (none)

    Non-standard INI settings:
    allow_url_include: "0" -> ""
    auto_append_file: (none) -> ""
    auto_prepend_file: (none) -> ""
    display_errors: "1" -> ""
    display_startup_errors: "1" -> ""
    enable_dl: "1" -> ""
    error_reporting: (none) -> "22527"
    html_errors: "1" -> "0"
    ignore_repeated_errors: "0" -> ""
    ignore_repeated_source: "0" -> ""
    implicit_flush: "0" -> "1"
    log_errors: "0" -> "1"
    mail.add_x_header: "0" -> ""
    mail.mixed_lf_and_crlf: "0" -> ""
    max_execution_time: "30" -> "0"
    memory_limit: "128M" -> "-1"
    request_order: (none) -> "GP"
    session.cookie_httponly: "0" -> ""
    session.gc_divisor: "100" -> "1000"
    session.gc_probability: "1" -> "0"
    session.sid_bits_per_character: "4" -> "5"
    session.sid_length: "32" -> "26"
    short_open_tag: "1" -> ""
    unserialize_callback_func: (none) -> ""
    user_dir: (none) -> ""
    variables_order: "EGPCS" -> "GPCS"
    zend.assertions: "1" -> "-1"
    zend.exception_ignore_args: "0" -> "1"
    zend.exception_string_param_max_len: "15" -> "0"

* Improve phrasing

Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>

* NEWS/UPGRADING

---------

Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
2025-02-05 17:54:52 +01:00
Christoph M. Becker
107bd080a5
Fix Clang style nits (GH-17685)
This addresses all `-Wlogical-op-parentheses` and `-Wmissing-braces`
warnings across the whole code base (all Windows specific code).
2025-02-05 14:13:56 +01:00
DanielEScherzer
dc7161cffe
UPGRADING: fix some typos [skip ci] (#17701) 2025-02-04 21:25:44 +01:00
Gina Peter Banyard
790286ab6c ext/pdo: Pass argument number to pdo_dbh_attribute_set() 2025-02-04 19:28:47 +00:00
Gina Peter Banyard
b6febd1356
ext/pdo: Revome useless ext/standard header include 2025-02-04 18:14:05 +00:00
Gina Peter Banyard
598f982a6b
ext/pdo: Add const modifiers to pdo_get_TYPE_param() functions 2025-02-04 18:13:33 +00: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
Ilija Tovilo
7ee1a87e7d
Merge branch 'PHP-8.4'
* PHP-8.4:
  [skip ci] Another flaky phar macOS test
2025-02-04 14:52:38 +01:00
Ilija Tovilo
d3101fb420
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  [skip ci] Another flaky phar macOS test
2025-02-04 14:52:31 +01:00
Ilija Tovilo
88e1917cb7
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Another flaky phar macOS test
2025-02-04 14:52:23 +01:00
Ilija Tovilo
99d2055670
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Another flaky phar macOS test
2025-02-04 14:52:15 +01:00
Ilija Tovilo
d8aedb589c
[skip ci] Another flaky phar macOS test 2025-02-04 14:52:03 +01:00
Gina Peter Banyard
4fcbdea974 ext/pdo: Turn lazy_object_ref into a zend_object* from a zval
This saves 8 bytes
2025-02-04 11:23:08 +00:00
Gina Peter Banyard
9054a8f214 ext/pdo: Add test for lazy fetch mode 2025-02-04 11:23:08 +00:00
Gina Peter Banyard
481bafe943 ext/pdo: Add static modifier for PDORow object handlers 2025-02-04 11:23:08 +00:00
Niels Dossche
9040e795ed
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix fallback paths in fast_long_{add,sub}_function
2025-02-03 22:43:24 +01:00
Niels Dossche
c7d3c5fcb1
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix fallback paths in fast_long_{add,sub}_function
2025-02-03 22:40:41 +01:00
Niels Dossche
7e06a81bbd
Fix fallback paths in fast_long_{add,sub}_function
This was asked to be checked in https://github.com/php/php-src/pull/17472#issuecomment-2591325036

There are 2 issues:
1) The UB in the if can overflow, and can be fixed by using zend_ulong
   for the sum/sub.
2) fast_long_sub_function() has a problem when result aliases.
   This is fixed in the same way as fast_long_add_function() works.

Closes GH-17666.
2025-02-03 22:38:00 +01:00
Christoph M. Becker
c1f7b87fb1
Fix MSVC C4267 warnings in gd.c (GH-17680)
These warnings are about conversion from `size_t` to a smaller type[1],
and in this case because `gdIOCtx` works with `int` lengths.  Two of
these warnings are harmless, and we resolve them by using `size_t` in
the first place, and adding a cast (plus an assertion), respectively.

The others actually hint at potential issues when reading image data
with more than `INT_MAX` bytes; we catch that upfront, and throw a
`ValueError` and a warning, respectively.

[1] <https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4267>
2025-02-03 21:02:15 +01:00
Christoph M. Becker
4373c601ea
Remove more unused local variables (GH-17688)
Since `pdo_odbc_ucs22utf8()` doesn't actually use the `stmt`, we drop
this parameter as well.
2025-02-03 20:06:29 +01:00
Niels Dossche
1879ec1713
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17577: JIT packed type guard crash
2025-02-03 19:38:04 +01:00
Niels Dossche
78da288222
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17577: JIT packed type guard crash
2025-02-03 19:35:32 +01:00
Niels Dossche
0c3cf1f311
Fix GH-17577: JIT packed type guard crash
When a guard check is created for a variable to check if it's a packed array,
it is possible that there was no prior type check for that variable.
This happens in the global scope for example when the variable aliases.
In the test, this causes a dereference of address 8 because the integer
element in `$a` is interpreted as an array address.

This patch adds a check to see if the guard is handled.
If we were not able to determine or guard the type then we also cannot know the array is packed.

Closes GH-17584.
2025-02-03 19:34:39 +01:00
Niels Dossche
9b7e08603b
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17654: Multiple classes using same trait causes function JIT crash
2025-02-03 19:28:26 +01:00
Niels Dossche
6d6380c09d
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17654: Multiple classes using same trait causes function JIT crash
2025-02-03 19:28:20 +01:00
Niels Dossche
f88445bdf8
Fix GH-17654: Multiple classes using same trait causes function JIT crash
This test has two classes that use the same trait. In function JIT mode
the same cache slot will be used. This causes problems because it is
primed for the first class and then reused for the second class,
resulting in an incorrect type check failure.

The current check for a megamorphic trait call requires current_frame to
not be NULL, but this is only set in tracing mode and not in function
mode.

This patch corrects the check.

Closes GH-17660.
2025-02-03 19:21:15 +01:00
Christoph M. Becker
4e6a3cecf5
Don't forward declare static functions in sendmail.h (GH-17684)
sendmail.h is not only included by sendmail.c, but also by
php_win32_globals.h, because that header uses some of the defined
macros.  However, the forward declarations of the static functions are
not needed anywhere else than in sendmail.c, and Clang warns about the
unused functions elsewhere (`-Wunused-function`).  Thus we move the
forward declarations to sendmail.c.
2025-02-03 16:50:32 +01:00
Christoph M. Becker
3fa9e283a0
Drop unused local variables (GH-17682) 2025-02-03 16:42:29 +01:00
Christoph M. Becker
caf5e8a167
Solve C4267 warnings in win32/ioutil for x64 (GH-17674)
C4267[1] are about conversion from `size_t` to a "smaller" type,
causing potential loss of data (aka. truncation).

In this case we can solve that cleanly (i.e. without casting and
further checks) by changing the affected variables to be of type
`DWORD`.

[1] <https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4267>
2025-02-03 00:13:58 +01:00
Gina Peter Banyard
6ae12093ce
ext/pdo: Rearrange struct to pack and group related fields together (#17651)
All bound related fields are now part of the same cache line
2025-02-02 21:25:29 +00:00
Niels Dossche
ff80ec70c6
Add enchant_dict_remove() (#17507) 2025-02-02 19:14:49 +01:00
Niels Dossche
50ed7b58bf
Add non-NULL assertion to zend_get_gc_buffer_add_obj() (#17671)
This would've saved me time when fixing the nightly failure in Laravel [1].

[1] e306a2e0
2025-02-02 19:09:53 +01:00
Christoph M. Becker
5f7a9ee97e
Merge branch 'PHP-8.4'
* PHP-8.4:
  Relax timezone_IDforWindowsID_basic2.phpt expectations
2025-02-02 13:39:13 +01:00
Christoph M. Becker
59ed63732f
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Relax timezone_IDforWindowsID_basic2.phpt expectations
2025-02-02 13:38:36 +01:00
Christoph M. Becker
76fccc2b02
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Relax timezone_IDforWindowsID_basic2.phpt expectations
2025-02-02 13:37:21 +01:00
Christoph M. Becker
036f00f146
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Relax timezone_IDforWindowsID_basic2.phpt expectations
2025-02-02 13:36:39 +01:00
Christoph M. Becker
afe8e2cdff
Relax timezone_IDforWindowsID_basic2.phpt expectations
Apparently, some ICU versions report "America/Los_Angeles" for the `ZZ`
case, what matches the behavior of ICU 76.1 (on Windows).  Possibly,
there has been some bug fix backport on some systems.  Anyhow, either
seems fine, so we're not picky about that.

Closes GH-17669.
2025-02-02 13:35:27 +01:00
Shivam Mathur
0d8aebf1d9
Fix condition to check for config.w32 in phpize (#17667) 2025-02-02 08:49:16 +05:30
Niels Dossche
e306a2e0e8
Add missing NULL checks in dbstmt_get_gc
This fixes the nightly Laravel failure: 3651202379
2025-02-01 23:58:44 +01:00
Christoph M. Becker
f1702d2bb1
Suppress MSVC C4995 warnings (deprecations)
These have the same meaning as C4996[1] (which we already suppress),
but are triggered by a different mechanism[2].  It makes no sense to
suppress one, but not both.

Of course it would be better not to suppress either, but wrt the two
C4995 warnings we see in php-src, that requires deprecation of using
the ODBC cursor library[3], so might take a while.

[1] <https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996>
[2] <https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4995>
[3] <https://externals.io/message/126264>

Closes GH-17664.
2025-02-01 22:48:43 +01:00
Christoph M. Becker
236e12e5f0
Drop --with-uncritical-warn-choke configuration option
This selection of suppressed warnings is pretty arbitrary, and
apparently disabling it does not raise any more warning for whole
php-src (except for `-Wno-deprecated-declarations`).  As such it
appears to be pretty useless, and it seems to be more appropriate to
let users select which warnings to suppress via manually set `CFLAGS`.

Since we already apply `/wd4996`[1] when building with MSVC, and there
are indeed plenty of deprecation warnings, for now, we apply
`-Wno-deprecated-declarations` for Clang builds unconditionally.

[1] <https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996>

Closes GH-17554.
2025-02-01 15:09:40 +01:00