1
0
mirror of https://github.com/php/php-src.git synced 2026-03-31 04:32:19 +02:00
Commit Graph

15907 Commits

Author SHA1 Message Date
Calvin Buckley
7fcb0a3d3d Update versions for PHP 8.4.0beta5
Signed-off-by: Calvin Buckley <calvin@cmpct.info>
2024-09-10 13:10:06 -03:00
Ilija Tovilo
025ed70ce3 Fix ReflectionProperty::isInitialized() for hooked props
In zend_std_has_property with ZEND_PROPERTY_EXISTS, we'd just return true when
no get hook was present. However, this function is supposed to return false for
uninitialized properties. PROPERTY_EXISTS is somewhat of a misnomer. Virtual
properties continue to always return true, given there's no backing value to
check.

Fixes GH-15694
Closes GH-15822
2024-09-10 14:46:16 +02:00
Niels Dossche
8bcfc8cc13 Implement request #47317: SoapServer::__getLastResponse()
Convenient for debugging.

Closes GH-15792.
2024-09-09 20:07:29 +02:00
Ilija Tovilo
0ff9e16247 [skip ci] Add missing NEWS entry for master 2024-09-09 16:44:11 +02:00
Niels Dossche
7771ec07e5 Fix bug #61525: SOAP functions require at least one space after HTTP header colon
HTTP/1.1 does not require a single whitespace after the colon, and
SoapServer does implement HTTP/1.1. The header value is already correctly
whitespace-trimmed, so no behaviour change happens w.r.t. header values.

Closes GH-15793.
2024-09-08 10:42:30 +02:00
DanielEScherzer
9b7dac4532 [skip ci] update NEWS for GH-15731 (#15756) 2024-09-05 00:26:31 +01:00
Christoph M. Becker
5d1181fb3f Fix GH-15742: php_hash_sha.h incompatible with C++
Not only MSVC doesn't support this construct, but apparently it is
generally not supported by C++ compilers.

Closes GH-15745.
2024-09-04 17:25:43 +02:00
Ayesh Karunaratne
24d4ae9d2f ext/curl: No-op CURLOPT_DNS_USE_GLOBAL_CACHE constant (GH-15127)
Libcurl `CURLOPT_DNS_USE_GLOBAL_CACHE` constant is no longer supported
since libcurl[^1] 7.62. This no-ops the constant, but without causing
any deprecation notices.

[^1]: [CURLOPT_DNS_USE_GLOBAL_CACHE](https://curl.se/libcurl/c/CURLOPT_DNS_USE_GLOBAL_CACHE.html)
2024-09-04 12:40:45 +02:00
Saki Takamachi
fad899e566 [RFC] Support object types in BCMath (#13741)
Added BcMath\Number class. It is an immutable object, has methods that are
equivalent to existing BCMath calculation functions, and can also be calculated
using operators.

The existing BCMath function returned a string for each calculation, but this
class returns an object.

RFC: https://wiki.php.net/rfc/support_object_type_in_bcmath,
https://wiki.php.net/rfc/fix_up_bcmath_number_class

---------

Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com>
2024-09-04 11:12:51 +09:00
Christoph M. Becker
3892529fed Close-GH 15685: improve proc_open error reporting on Windows
While similar errors are already reported via `strerror()` on other
platforms, this has apparently overlooked for Windows, where only the
error code has been reported so far.

We adapt the affected test cases, but since there is no PHP userland
function which allows us to get the current system locale, we work
around.

Closes GH-15687.
2024-09-03 13:12:27 +02:00
Ilija Tovilo
407bc092db [skip ci] Fix NEWS reflection category 2024-09-03 11:33:04 +02:00
Daniel Scherzer
18df69ee34 ReflectionProperty::get{Hook,Hooks}(): handle dynamic properties
For dynamic properties, instead of crashing with a segmentation fault, just say
that there are no hooks. Also includes a test to prevent regression.

Fixes GH-15718
Closes GH-15721
2024-09-03 11:31:15 +02:00
Niels Dossche
0d616d1b82 Fix GH-15693: Unnecessary include in main.c bloats binary
Closes GH-15700.
2024-09-02 21:54:13 +02:00
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
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
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
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
Ayesh Karunaratne
a8df3d1eed ext/curl: libcurl CURLOPT_{FTP_RESPONSE_TIMEOUT,ENCODING} replacements (#15126) 2024-08-31 14:26:11 +01: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
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
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
David Carlier
307565d577 ext/gd: porting gdImageClone to the bundled libgd version.
close GH-15640
2024-08-29 23:13:20 +01:00
Arnaud Le Blanc
180a5c3ccc [ci skip] NEWS for GH-15330 2024-08-28 17:46:22 +02:00
Arnaud Le Blanc
0e9e5912c1 [ci skip] NEWS for GH-15330 2024-08-28 17:45:32 +02:00
Arnaud Le Blanc
4db78140a0 [ci skip] NEWS for GH-15330 2024-08-28 17:44:20 +02:00
Niels Dossche
88393cfaf7 Fix GH-13988: Storing DOMElement consume 4 times more memory in PHP 8.1 than in PHP 8.0
We avoid creating backing storage by using the feature introduced in
f78d5cfcd2.

Closes GH-15593.
2024-08-27 20:14:25 +02:00
Saki Takamachi
8f3dc78da1 [ci skip] Update NEWS for PHP 8.4.0 beta4 2024-08-27 23:19:37 +09:00
David Carlier
3ed884fab7 [ci skip] NEWS 2024-08-27 04:59:06 +01:00
David Carlier
f7186a06e5 Merge branch 'PHP-8.3' 2024-08-27 04:57:45 +01:00
David Carlier
618edb5e15 Merge branch 'PHP-8.2' into PHP-8.3 2024-08-27 04:57:13 +01:00
David Carlier
cc67220ea3 Fixed GH-15547: curl_multi_wait expects a signed int for timeout.
confusion might come from the previous argument type.
PHP expects ms so we check it fits integer boundaries before the cast.
raising a warning at least for stable branches.

close GH-15548
2024-08-27 04:56:32 +01:00
Ilija Tovilo
8df557ac42 [RFC] Asymmetric visibility v2 (GH-15063)
Co-authored-by: Larry Garfield <larry@garfieldtech.com>
2024-08-27 02:04:48 +02:00
Ilija Tovilo
606eb849bb Stop recording of trace when encountering hook
Fixes GH-15178
2024-08-26 17:27:50 +02:00
Ilija Tovilo
b839c5f1af Fix building of callgraph including preloaded symbols (GH-15545)
This issue was introduced in GH-15021. When building the call graph, we can now
see preloaded functions. However, building the call graph involves adding the
function to the caller list of the callee, which we don't want to do for
functions not coming from the script.

Fixes GH-15490
2024-08-26 17:22:04 +02:00
^_^
555b603d23 mysqlnd: support ER_CLIENT_INTERACTION_TIMEOUT (#13618) 2024-08-26 12:52:26 +09:00
Peter Kokot
5c44610093 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15587: Autotools: fix configure check for aarch64 CRC32 API
2024-08-25 18:01:33 +02:00
Bernd Kuhls
5947db6bb8 Fix GH-15587: Autotools: fix configure check for aarch64 CRC32 API
On arm32 bit the check succeeds leading to a build error later on:

/home/autobuild/autobuild/instance-3/output-1/build/php-8.3.10/ext/standard/crc32.c:70:12:
 error: 'armv8-a' does not support feature 'nothing'
   70 | #   pragma GCC target ("+nothing+crc")

Co-authored-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[http://lists.busybox.net/pipermail/buildroot/2024-August/761151.html]
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
2024-08-25 18:00:29 +02:00