Commit Graph

137693 Commits

Author SHA1 Message Date
Ilija Tovilo
2b8a1b4258
Forbid a-vis on unilateral virtual prop
The get-only case is obvious, there is no set operation so specifying its
visibility is senseless. The set-only case is also questionable, since there is
no operation other than set, so changing the visibility of the entire property
is preferable.

Closes GH-15698
2024-09-02 17:40:30 +02:00
Remi Collet
b81f9722db
[ci skip] NEWS and UPGRADING for PASSWORD_ARGON2 on openssl 2024-09-02 13:13:54 +02:00
Remi Collet
32c5ce3451
Implement GH-13514 PASSWORD_ARGON2 from OpenSSL 3.2 (#13635)
* Implement GH-13514 PASSWORD_ARGON2 from OpenSSL 3.2

* simplify init/shutdown

* use php_base64_encode_ex

* - rename macros - use openssl RAND_bytes - CS

* add --with-openssl-argon2 build option

* check OSSL_KDF_PARAM_ARGON2_LANES instead of OSSL_set_max_threads

* Cleanup and CS

* save/restore old threads config + CS

* remove unneeded check
2024-09-02 13:01:09 +02:00
Ilija Tovilo
64bd828394
[skip ci] Update mysql versions for libmysql build 2024-09-02 12:31:56 +02:00
Ilija Tovilo
e7c2017fc6
Merge branch 'PHP-8.3'
* PHP-8.3:
  [skip ci] Backport libmysql build fix (d9a9696)
2024-09-02 12:09:42 +02:00
Ilija Tovilo
d7febabd23
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  [skip ci] Backport libmysql build fix (d9a9696)
2024-09-02 12:09:36 +02:00
Ilija Tovilo
57f9041165
[skip ci] Backport libmysql build fix (d9a9696) 2024-09-02 12:08:55 +02:00
Christoph M. Becker
4dc77953eb
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix run-tests.php to propagate status code on Windows
2024-09-02 00:53:02 +02:00
Christoph M. Becker
71b908748a
Fix run-tests.php to propagate status code on Windows
There is now a workaround in `system_with_timeout()` to avoid issues
with quotes and spaces in the filenames of the executable by using
`start`[1].  However, calling `start` will not propagate the process
status of the actual process.  Thus, calling `proc_get_status()`
is pretty meaningless, and especially Microsoft errors cannot be
detected (typically, access violations etc.), and as such no "Termsig"
message is output.

We fix this by executing `exit` after the started command has finished.

[1] <a6d7d5234b/run-tests.php (L1157-L1162)>

Closes GH-15378.
2024-09-02 00:52:31 +02:00
Peter Kokot
8699da6f33
Autotools: Document PHP environment build configuration vars (#15684)
This marks the following environment variables as precious:

- PHP_BUILD_ARCH
- PHP_BUILD_COMPILER
- PHP_BUILD_PROVIDER
- PHP_BUILD_SYSTEM
- PHP_UNAME

Meaning, they are now also shown in the `./configure --help` output, and
they can be used like this when configuring the PHP build:

    ./configure PHP_BUILD_ARCH="..." PHP_BUILD_COMPILER="..."  ...
2024-09-01 23:57:33 +02:00
Niels Dossche
5ca4d8828d
Remove redundant 'zobj->ce->__isset' check (#15699)
This became unnecessary due to the addition of lazy objects that added
the goto when '!zobj->ce->__isset' above.
2024-09-01 23:10:54 +02:00
Jorg Adam Sowa
2a30f2ffc4
Add type indicator to array/arg unpack error messages (GH-15448) 2024-09-01 22:57:12 +02:00
Peter Kokot
de6658531f
Autotools: Fix iconv shared build with external library (#15686)
When building iconv as shared and with external library (for example, libiconv):

    ./configure --with-iconv=shared,/path/to/libiconv

the iconv couldn't be found due to a linker error.

Autoconf places LDFLAGS before the conftest.c file in the test compile
command and LIBS after it. GCC also requires this:

    gcc -L... conftest.c -liconv

Similar issue discovered at
https://github.com/remicollet/php-xpass/pull/1
2024-09-01 22:06:37 +02:00
Ayesh Karunaratne
fde34bc1e8
ext/curl: Update UPGRADING and NEWS for GH-13255 (#15668)
[ci skip]
2024-09-01 18:55:34 +02:00
jrfnl
95c5a5a959 [skip ci] PHP 8.4 changelog: fix typo in new constant
Ref: PR 15479 / d713e3619e
2024-09-01 18:51:31 +02:00
jrfnl
ced1e4509a [skip ci] PHP 8.4 changelog: add MYSQLI_TYPE_VECTOR to new constants
Ref: PR 15431 / a1ab846231
2024-09-01 18:51:31 +02:00
jrfnl
7bfd9d4a63 [skip ci] PHP 8.4 changelog: more alphabetic order fixes 2024-09-01 18:51:31 +02:00
Christoph M. Becker
c013679b70
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15552: Signed integer overflow in ext/standard/scanf.c
2024-09-01 17:26:46 +02:00
Christoph M. Becker
a51f54b54b
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15552: Signed integer overflow in ext/standard/scanf.c
2024-09-01 17:25:18 +02:00
Christoph M. Becker
08841bf79c
Fix GH-15552: Signed integer overflow in ext/standard/scanf.c
We ensure that the argnum `value` is in the allowed range, *before*
mapping it to the `objIndex`, not *afterwards*.

Closes GH-15581.
2024-09-01 17:24:17 +02:00
Christoph M. Becker
0b1e401f2c
Skip tests calling wmic if it is not available
The WMIC utitlity is deprecated as of Windows 10 21H1, and a feature on
demand which is enabled by default in Windows 11 22H2 and 23H2, but
will be disabled by default in the next release of Windows.[1]

Therefore, we ensure that tests which rely on wmic.exe are properly
skipped if it is not available.

[1] <https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features#deprecated-features>

Closes GH-15583.
2024-09-01 17:19:37 +02:00
Christoph M. Becker
2bb5dea7b1
Merge branch 'PHP-8.3' [skip ci]
* PHP-8.3:
  Mark gd14930.phpt as dynamic xfail
2024-09-01 15:06:31 +02:00
Christoph M. Becker
ac4039df20
Mark gd14930.phpt as dynamic xfail
This test only fails when `NAME_MAX` is defined, which is never the
case on Windows, so we let the test pass there.  This could be extended
to other environments where `NAME_MAX` is not defined.
2024-09-01 15:04:54 +02:00
Christoph M. Becker
55f519b178
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15628: php_stream_memory_get_buffer() not zero-terminated
2024-09-01 14:58:14 +02:00
Christoph M. Becker
5f504f10dd
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15628: php_stream_memory_get_buffer() not zero-terminated
2024-09-01 14:56:54 +02:00
Christoph M. Becker
93021c635d
Fix GH-15628: php_stream_memory_get_buffer() not zero-terminated
We're reasonably sure that appending the NUL is not an OOB write, since
the memory stream implementation uses `zend_string` APIs instead of
fiddling with the buffer.

We don't add a regression test because that would require to set up
something in the zend_test extension, and regressions are supposed
to be caught by external consumers of this API, such as mailparse.

Closes GH-15648.
2024-09-01 14:55:40 +02:00
Christoph M. Becker
a57ce052cd
Don't export php_pdo_int.h
This is, as the name and a comment in the header imply, an internal
header which is not supposed to be used by extensions other than PDO
(not even by drivers).

Since there is apparently no need to include this header in the parsers
of the drivers, we remove these includes, and no longer declare the
header to be installed.  Given that the header is only exported for a
couple of weeks[1], this is not considered to be a BC break, because
it's unlikely that external drivers have already been adjusted to use
this header, and otherwise they can still be fixed; PHP 8.4 is still in
the pre-release stage.

[1] <https://github.com/php/php-src/pull/14797>

Closes GH-15688.
2024-09-01 13:33:53 +02:00
Peter Kokot
1a126c540a
Autotools: Normalize flags arguments (#15671)
This is a follow up of 7edb9a07d7 that
provides passing compilation options to PHP_NEW_EXTENSION,
PHP_ADD_SOURCES, PHP_ADD_SOURCES_X, and PHP_SELECT_SAPI as a
blank-or-newline-separated argument.
2024-09-01 01:02:40 +02:00
Christoph M. Becker
0f8259e896
ICU 75.1 requires C++17 (GH-15678)
This needs to be explicitly enabled for MSVC (and probably clang on
Windows); otherwise the default is C++14, which is no longer sufficient
for ICU[1].

While the official PHP 8.4 builds for Windows do not yet use ICU 75.1,
that may change[2].  And even if not, it would be nice for custom
builds to be able to build against ICU 75.1 (or later).

Anyhow, using `std:c++17` is fine for ICU 72.1 which we are currently
using (and likely for some older ICU versions).

[1] <https://github.com/unicode-org/icu/releases/tag/release-75-1>
[2] <https://github.com/winlibs/icu4c/pulls>
2024-08-31 17:01:49 +02:00
Christoph M. Becker
b3d6414b87
Drop support for building with MSC_VER < 1920
`MSC_VER` 1920 refers to Visual Studio 2019 RTW 16.0[1], and this
should be the bare minimum which we support nowadays.  If users use an
older Visual Studio version, we fail gracefully during `configure`.

[1] <https://learn.microsoft.com/en-us/cpp/overview/compiler-versions?view=msvc-170>

Closes GH-15403.
2024-08-31 17:00:21 +02:00
Ayesh Karunaratne
a8df3d1eed
ext/curl: libcurl CURLOPT_{FTP_RESPONSE_TIMEOUT,ENCODING} replacements (#15126) 2024-08-31 14:26:11 +01:00
Niels Dossche
82c504fa9c
Fix GH-15670: Polymorphic cache slot issue in DOM (#15676)
A cache slot can be hit with different DOM object types, so we should
check if we're still handling the same type.
2024-08-31 12:13:21 +02:00
Niels Dossche
73b7993b0d
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15654: Signed integer overflow in ext/dom/nodelist.c
2024-08-31 11:56:34 +02:00
Niels Dossche
9cb23a3dec
Fix GH-15654: Signed integer overflow in ext/dom/nodelist.c
There's implicit truncation casts from zend_long to int which cause
issues because checks are done against the zend_longs. Since the
iterator infrastructure uses zend_longs, just convert everything to
zend_long.

Closes GH-15669.
2024-08-31 11:47:08 +02:00
Saki Takamachi
166f343d59
[skip ci] NEWS for Fixed LONG_MAX in BCMath ext (#15663) 2024-08-31 18:23:36 +09:00
Saki Takamachi
44ec179b7e
NEWS for ext/bcmath: Fixed bcdiv() div by one (#15629) 2024-08-31 17:52:44 +09:00
Simonov Denis
eb3e7a2c0c
ext/pdo_firebird: Fixed GH-15604 Always make input parameters nullable (#15605)
Fixes #15604
Closes #15605
2024-08-31 17:06:41 +09:00
Go Kudo
b221f21b49 Merge branch 'PHP-8.3' 2024-08-31 15:58:13 +09:00
Go Kudo
8ad7d8f1cd Merge branch 'PHP-8.2' into PHP-8.3 2024-08-31 15:57:26 +09:00
Go Kudo
bf9929a26c
standard: supress msan (#15665) 2024-08-31 15:56:11 +09:00
Peter Kokot
5ed1659039
Autotools: Fix pdo_mysql build with mysql client library (#15450)
When using --with-pdo-mysql=DIR and for some reason DIR wouldn't have
the executable DIR/bin/mysql_config available the 3rd option was so far
to guess the mysql client library locations and pass the include
directory further. The library directory and library name to link was
missing. This fixes this case for consistency reasons. And in the future
also the pkg-config could be a reliable alternative to mysql_config in
that case. The PDO_MYSQL_INC_DIR is already processed PHP_EVAL_INCLINE
so redundant PHP_ADD_INCLUDE is removed.
2024-08-31 02:35:34 +02:00
Peter Kokot
558ccf7362
Autotools: Add 3rd argument to dba PHP_TEMP_LDFLAGS
[skip ci]
2024-08-31 00:41:41 +02:00
Peter Kokot
b7db7708c3
Autotools: Refactor ODBC type checks (#15651)
- AS_VAR_IF macros used
- All check messages moved to the PHP_ARG_WITH 2nd argument and results
  simplified where possible (the ext_output variable and result message
  is done automatically when using PHP_ARG_* macros)
- Unusued ODBC_SHARED and ODBC_STATIC shell variables for DBMaker
  removed
- Help text for --with-unixodbc (and/or --with-unixODBC) configure
  option synced with current Autotools code. It is still possible to
  bypass the pkg-config search with optional DIR argument
2024-08-30 23:54:11 +02:00
Peter Kokot
75c797492b
Autotools: Replace backticks with $(...) in php.m4 (#15642)
This is a follow-up of GH-15639
2024-08-30 23:32:42 +02:00
David Carlier
fc01e2ee2b
Merge branch 'PHP-8.3' 2024-08-30 17:17:44 +01:00
David Carlier
d7d40b4c80
Merge branch 'PHP-8.2' into PHP-8.3 2024-08-30 17:17:20 +01:00
David Carlier
7db1a5843f
Fix GH-15653: fgetcsv overflow on length parameter.
close GH-15655
2024-08-30 17:16:57 +01:00
Saki Takamachi
a27878cff3
Fixed LONG_MAX in BCMath ext (#15663) 2024-08-31 01:07:33 +09:00
Arnaud Le Blanc
58aa6fc830
Lazy objects
RFC: https://wiki.php.net/rfc/lazy-objects

Closes GH-15019
2024-08-30 17:30:03 +02:00
Ilija Tovilo
e12188fe89
Fix asymmetric visibility with set hook
Fixes GH-15644
Closes GH-15645
2024-08-30 09:42:27 +02:00