Commit Graph

15227 Commits

Author SHA1 Message Date
Niels Dossche
4bd63568fb
Fix argument type of simplexml_import_dom (#13170)
It needs to be "object".
This is because first- and third-party extension can register custom
node types using `php_libxml_register_export`. So we don't know upfront
what types can be expected.

This also changes the error to a TypeError everywhere.
2024-01-18 20:28:01 +01:00
Ayesh Karunaratne
8cc472d5d0 ext/intl: Add NumberFormatter::ROUND_HALFODD
The NumberFormatter::ROUND_HALFEVEN constant exists in PHP already, but its counterpart ROUND_HALFODD was missing.
This adds it, using `UNUM_ROUND_HALF_ODD`

Close GH-13191
2024-01-18 18:12:44 +00:00
Saki Takamachi
c334de8a0a
[skip ci] Fixed NEWS 2024-01-17 01:58:47 +09:00
Saki Takamachi
bdd7711ba7
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-13119 (#13125)
2024-01-17 01:49:41 +09:00
Saki Takamachi
f234104379
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-13119 (#13125)
2024-01-17 01:14:33 +09:00
SakiTakamachi
fa751c7dd6
Fix GH-13119 (#13125)
Fixed an issue where pdo_firebird float and double type values were wrong.

Changed from using `%F` format with `zend_strpprintf` to using `%H` format with
`zend_strpprintf_unchecked`.

Fixes GH-13119
Closes GH-13125
2024-01-17 01:12:24 +09:00
David Carlier
719c74e919 Merge branch 'PHP-8.2' into PHP-8.3 2024-01-14 18:24:08 +00:00
David Carlier
5e2a586c9a ext/openssl: fix libressl build.
Close GH-12919
2024-01-14 18:23:18 +00:00
Ilija Tovilo
ed64949d12
strtok is not comptime()
Fixes GH-13145
Closes GH-13148
2024-01-14 19:12:41 +01:00
Tim Düsterhus
f2f070a897
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  random/standard: Correctly handle broken engines in php_array_pick_keys (#13138)
2024-01-14 13:03:33 +01:00
Tim Düsterhus
97c6da1dec
random/standard: Correctly handle broken engines in php_array_pick_keys (#13138) 2024-01-14 13:01:29 +01:00
Niels Dossche
90785dd865
[RFC] Improve callbacks in ext/dom and ext/xsl (#12627) 2024-01-13 00:00:26 +01:00
Máté Kocsis
2ae2af5e2e
Fix missing periods in the NEWS file
[skip-ci]
2024-01-12 14:15:30 +01:00
Max Semenik
a2b2830f9b
ext/standard: make debug_zval_dump() output whether the array is packed (#12641) 2024-01-12 00:33:14 +00:00
Máté Kocsis
d6a0b3af68
Implement PDO driver-specific subclasses
RFC: https://wiki.php.net/rfc/pdo_driver_specific_subclasses
Closes GH-12804

Co-Authored-By: Danack <Danack@basereality.com>
2024-01-11 23:22:41 +01:00
David Carlier
b985a31b0a sapi/fpm: setting backlog default to -1 for DragonFlyBSD.
like most of BSD, when negative the syscall sets it internally to
SOMAXCONN.

close GH-13077
2024-01-11 20:39:41 +00:00
Jakub Zelenka
1c7dc0f300
Merge branch 'PHP-8.2' into PHP-8.3 2024-01-11 16:48:03 +00:00
Jakub Zelenka
b04b09ef56
Fix GH-12996: Incorrect SCRIPT_NAME with Apache ProxyPassMatch when plus in path
Closes GH-13072
2024-01-11 16:47:08 +00:00
hanshenrik
fc16285538 ext/curl: deprecate CURLOPT_BINARYTRANSFER
This is long overdue, CURLOPT_BINARYTRANSFER has been a no-op since PHP5.1.2 in 2004 (ref https://bugs.php.net/bug.php?id=55635 )

Close GH-13114.
2024-01-10 18:16:52 +00:00
Peter Kokot
04954f6b2c Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Set libtool tag per command instead of global one
2024-01-10 09:13:39 +01:00
Jan Palus
d57a7767a2 Set libtool tag per command instead of global one
Global --tag=CC defined in configure.ac is not correct in all cases. For example
linking objects that were compiled from C++ sources needs to be done with C++
compiler, however for link mode libtool will prefer compiler indicated with
--tag.

Fixes GH-12349
2024-01-10 09:09:45 +01:00
David Carlier
7d238bf2d5 Merge branch 'PHP-8.2' into PHP-8.3 2024-01-09 22:01:15 +00:00
David Carlier
1e464e5b55 ext/gd: Fix GH-13082
Issue occur when compiling with recent clang releases (> 13) and
 with the '-Os' optimisation level, after using
`imageloadfont` which returns a proper GdFont class leads to
 a subtle bug when attempting to use via the imagefont* function.
2024-01-09 22:01:00 +00:00
Niels Dossche
1d6f344bea Fix GH-13094: range(9.9, '0') causes segmentation fault
`start_type + end_type < 2*IS_STRING` is not right, in this test case
the types are start_type==5 (IS_DOUBLE), end_type==7 (IS_ARRAY).
The IS_ARRAY type is a sentinel to disambiguate single-byte strings.
The path must be taken when one of the types is not a string nor a
single-byte string. Therefore, use < IS_STRING with an OR condition.

Closes GH-13105.
2024-01-09 22:11:45 +01:00
haszi
90800b62bb
Change PHP_ZTS and PHP_DEBUG to bool to match their ZEND equivalents (#13079)
Co-authored-by: haszi <haszika80@gmail.com>
2024-01-07 13:38:26 +00:00
Arnaud Le Blanc
3a237b96a0 [ci skip] NEWS 2024-01-05 19:47:08 +01:00
Arnaud Le Blanc
29cb814836 [ci skip] NEWS 2024-01-05 19:45:18 +01:00
Jakub Zelenka
1612a716a0
[ci-skip] Add missing credit for openssl_csr_sign serial_hex to Florian 2024-01-05 14:43:29 +00:00
Jakub Zelenka
e0679f3d5e
Introduce new serial_hex parameter to openssl_csr_sign
Co-authored-by: Florian Sowade <f.sowade@suora.com>

Closes GH-13023
Closes GH-9851
2024-01-05 14:40:22 +00:00
Niels Dossche
7525e690f6 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix #71465: PHAR doesn't know about litespeed
2024-01-03 21:34:59 +01:00
Niels Dossche
85dbbe19e2 Fix #71465: PHAR doesn't know about litespeed
We should perhaps look into a generic system to ask the SAPI whether
a feature should be supported or not. Or, we should look into making
a denylist instead of an allowlist.
Anyway, let's not try doing anything fancy on stable branches.

Closes GH-13070.
2024-01-03 21:31:09 +01:00
Jakub Zelenka
d33a534863
PHP-8.3 is now for PHP-8.3.3-dev 2024-01-02 15:50:36 +00:00
Sergey Panteleev
5d79c1b74d
PHP-8.2 is now for PHP 8.2.16-dev 2024-01-02 16:42:14 +03:00
Niels Dossche
e787790cfc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix #77432: Segmentation fault on including phar file
2024-01-01 13:46:27 +01:00
Niels Dossche
1edcfccdca Fix #77432: Segmentation fault on including phar file
phar_get_pharfp() can return NULL. In this case this is because the
stream gets closed by the include code in the engine. However, the phar
entry is still cached, so when the next include happens the engine tries
to read from a closed (and nullified) stream.
Use the same fix as in phar_open_entry_fp(): take into account that the
phar_get_pharfp() can return NULL and in that case reopen the phar
archive.

Closes GH-13056.
2024-01-01 13:45:40 +01:00
David Carlier
b02f95adae ext/sockets: adding windows SO_EXCLUSIVEADDRUSE constant.
Close GH-13030
2023-12-28 15:38:58 +00:00
Niels Dossche
02758ec376 [ci skip] Fixes in NEWS 2023-12-27 23:26:37 +01:00
Niels Dossche
42575ac966 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12974: Apache crashes on shutdown when using pg_pconnect()
2023-12-27 20:16:32 +01:00
Niels Dossche
77ac1e8592 Fix GH-12974: Apache crashes on shutdown when using pg_pconnect()
On ZTS, the global variables are stored in dynamically allocated memory.
When the module gets shut down this memory is released. After the module
is shut down, only then are the persistent resources cleared. Normally
this isn't an issue, but pgsql and odbc refer to the globals to modify
some counters, after the globals have been freed.
Fix this by guarding the modification.

Closes GH-13032.
2023-12-27 20:14:23 +01:00
Michael Orlitzky
85e5635a8e Fix detection of image formats in system gd library
- Use gdFontCacheShutdown() to detect freetype
  Currently we look for gdImageStringFT() to determine whether or not gd
  has freetype support... but that function always exists. This leads
  PHP to believe that gd has freetype support when it does not, and can
  lead to build failures.

  The gdFontCacheShutdown() function, on the other hand, is only present
  when gd was built with freetype support. Let's use that instead.

- Fix GD image format detection
  We currently check for, say, AVIF support by attempting to link a
  program that calls libgd's gdImageCreateFromAvif() function. But
  perversely, that function always exists in libgd; moreover when AVIF
  support is missing it emits a warning and returns normally. Thus
  our straightforward link test becomes not so straightforward.

  This commit adds a new macro PHP_GD_CHECK_FORMAT that compiles, links,
  and runs a test program instead. The test program overrides that "emit
  a warning" handler so that the program actually fails if the format
  we're looking for is not supported. This fixes detection of AVIF and
  the other formats we check for in an external libgd.

- ext/gd/tests/bug77391.phpt: skip if gd lacks BMP support
  I don't actually know how to remove BMP support from libgd, but PHP
  has a ./configure test for it, so we should probably treat it as
  optional.

Closes GH-12019
2023-12-27 14:12:32 +01:00
Niels Dossche
93951cf5ab Fix GH-13012: DOMNode::isEqualNode() is incorrect when attribute order is different
Attributes (and namespace declarations) have to be compared in an
unordered way.

Closes GH-13017.
2023-12-27 02:22:23 +01:00
David Carlier
0c8e45e71f Merge branch 'PHP-8.2' into PHP-8.3 2023-12-23 17:15:06 +00:00
David Carlier
d98a45d08c ext/pgsql: pgsql.allow_persistent, no need to use such large type for boolean state.
also ext/odbc, simplifying odd comparison with non persistent connections.

Close GH-12976
2023-12-23 17:14:48 +00:00
Niels Dossche
5f69232b53 Revert "Fix crashes with entity references and predefined entities"
This reverts commit 3fa5af8496.
2023-12-23 17:31:18 +01:00
Niels Dossche
3fa5af8496 Fix crashes with entity references and predefined entities
There's two issues here:
- freeing of predefined entity declaration crashes (unique to 8.3 & master)
- using multiple entity references for a single entity declaration crashes
  (since forever)

The fix for the last issue is fairly easy to do on 8.3, but may require a
slightly different approach on 8.2. Therefore, for now this is 8.3-only.

Closes GH-13004.
2023-12-23 17:00:57 +01:00
Niels Dossche
8e8d5ce240 Fix crash in adoptNode with attribute references
I forgot to also update the document reference of attributes, so when
there is no document reference anymore from a variable, but still an
attribute, this can crash. Fix it by also updating the document
references for attributes.

Closes GH-13002.
2023-12-23 16:58:11 +01:00
Niels Dossche
b2d778c36e Fix crash when toggleAttribute() is used without a document 2023-12-22 21:12:59 +01:00
David Carlier
f20edf0fb3 Merge branch 'PHP-8.2' into PHP-8.3 2023-12-22 17:26:20 +00:00
David Carlier
6a447e7437 GH-12943 ext/intl accept C as acceptable locale argument.
Close GH-12955
2023-12-22 17:26:09 +00:00
Niels Dossche
b1206ea965 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12980: tidynode.props.attribute is missing "Boolean Attributes" and empty attributes
2023-12-22 17:38:15 +01:00