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

132662 Commits

Author SHA1 Message Date
George Peter Banyard
3d4ff5ae22 RFC: Deprecate remains of string evaluated code assertions (#11671)
Link: https://wiki.php.net/rfc/assert-string-eval-cleanup
2023-07-13 15:45:32 +01:00
Marc Bennewitz
591f3f619e Prevent decimal int precision loss in number_format()
Closes GH-11584
2023-07-13 15:30:30 +01:00
Niels Dossche
d17069e191 Implement DOMNode::getRootNode()
ref: https://dom.spec.whatwg.org/#dom-node-getrootnode

Closes GH-11693.
2023-07-13 16:27:28 +02:00
Niels Dossche
10d7e8dc3a Implement DOMElement::getAttributeNames()
ref: https://dom.spec.whatwg.org/#dom-element-getattributenames
2023-07-13 16:18:10 +02:00
Niels Dossche
b3899eb569 Refactor dom_node_node_name_read() to avoid double allocation
We will use this helper later outside of the node name read handler.
2023-07-13 16:18:10 +02:00
Niels Dossche
62ef7bb27a Merge branch 'PHP-8.2'
* PHP-8.2:
  Handle fragments consisting out of multiple children without a single root correctly
2023-07-13 16:12:49 +02:00
Niels Dossche
f2ed2b877d Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Handle fragments consisting out of multiple children without a single root correctly
2023-07-13 16:12:35 +02:00
Niels Dossche
5c26258eeb Handle fragments consisting out of multiple children without a single root correctly
Closes GH-11698.
2023-07-13 16:09:04 +02:00
Niels Dossche
f04e5059bb Avoid allocations in DOMElement::getAttribute() 2023-07-13 16:07:57 +02:00
Niels Dossche
9880c336be Avoid string allocation in dom_get_dom1_attribute() for as long as possible 2023-07-13 16:07:57 +02:00
Ilija Tovilo
66e2aa7255 Fix use-of-uninitialized-value when calling php_posix_stream_get_fd (#11694)
Passing a double pointer to php_stream_cast means the caller of
php_posix_stream_get_fd will never receive the actual value. Moreover,
php_posix_stream_get_fd may only write the low sizeof(php_socket_t) bytes of fd,
so we need to initialize the upper bytes to 0 to avoid partial
use-of-uninitialized-value.
2023-07-13 15:21:36 +02:00
Jorg Adam Sowa
0313640b48 Reorder list construction in the function php_intpow10 (#11683)
* Reorder array construction in the function
* Optimize function php_intlog10abs
2023-07-13 13:46:45 +01:00
Cristian Rodríguez
5572975ba7 proc_open: Use posix_spawn(3) interface on systems where it is profitable
As the size of the PHP process increases, forking gets slower and memory
consumption increases, degrading the performance in varying degrees.

This patch makes proc_open use posix_spawn only on systems which is known to be
safe, faster than the HAVE_FORK path and have posix_spawn_file_actions_addchdir_np(3)
action.
Non scientific benchmark shows running php own's test suite on linux completes
dozens of seconds faster, the impact is probably higher on systems where
posix_spawn is a syscall.

Closes GH-7933
2023-07-13 13:29:42 +01:00
David CARLIER
a077c2dd6c Merge branch 'PHP-8.2' 2023-07-13 12:40:59 +01:00
David CARLIER
0309800b4d Merge branch 'PHP-8.1' into PHP-8.2 2023-07-13 12:40:47 +01:00
David Carlier
69b4360e88 zend_gdb disable gdb detection for FreeBSD < 11.
ref PR: https://github.com/php/php-src/pull/11599.

Close GH-11646
2023-07-13 12:39:58 +01:00
Ilija Tovilo
d9db446065 Fix iface const visibility variance check 2023-07-13 10:52:58 +02:00
Ilija Tovilo
7343ae5d3c Fix missing iface class const inheritance type check 2023-07-13 10:40:19 +02:00
Niels Dossche
ea794e9cde Implement DOMNode::contains()
ref: https://dom.spec.whatwg.org/#dom-node-contains
2023-07-12 19:29:07 +02:00
George Peter Banyard
2aaa7997a2 Merge branch 'PHP-8.2'
* PHP-8.2:
  ext/intl: Fix memory leak in MessageFormatter::format()
2023-07-12 15:45:24 +01:00
George Peter Banyard
1e41b0f1a5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  ext/intl: Fix memory leak in MessageFormatter::format()
2023-07-12 15:44:41 +01:00
George Peter Banyard
536dbd74fa ext/intl: Fix memory leak in MessageFormatter::format()
Closes GH-11658
2023-07-12 15:43:45 +01:00
Ilija Tovilo
c1a7058e66 Merge branch 'PHP-8.2'
* PHP-8.2:
  Always memoize assert
2023-07-12 16:36:14 +02:00
Ilija Tovilo
6d98c085a1 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Always memoize assert
2023-07-12 16:36:08 +02:00
Ilija Tovilo
b1b7c61a27 Always memoize assert
Closes GH-11686
2023-07-12 16:35:09 +02:00
Ilija Tovilo
0250468b87 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix bug-gh11600.phpt
2023-07-12 14:55:14 +02:00
Ilija Tovilo
57229836d4 Fix bug-gh11600.phpt 2023-07-12 14:54:56 +02:00
Ilija Tovilo
65ff764d24 Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Mark bug-gh11600 as xfail
2023-07-12 14:08:49 +02:00
Ilija Tovilo
892704267c [skip ci] Mark bug-gh11600 as xfail 2023-07-12 14:08:28 +02:00
Ilija Tovilo
a833937725 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix double-compilation of arrow-function
2023-07-12 11:01:38 +02:00
Ilija Tovilo
060df83a98 Fix double-compilation of arrow-function
We transform the arrow function by nesting the expression into a return
statement. If we compile the arrow function twice this would be done twice,
leading to a compile assertion.

Fix oss-fuzz #60411
Closes GH-11632
2023-07-12 11:01:23 +02:00
Niels Dossche
66555a9fca Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix bug-gh11600.phpt to work with different ICU versions
2023-07-12 10:36:26 +02:00
Niels Dossche
9c47f33a5f Fix bug-gh11600.phpt to work with different ICU versions 2023-07-12 10:35:59 +02:00
George Peter Banyard
59f6d08f83 ext/posix: posix_isatty() fix use-of-uninitialized-value (#11676)
When the value passed is not representable as an int then it is not a TTY and thus should return false immediately.

This was reported by MSAN.
2023-07-11 23:55:18 +01:00
Niels Dossche
b79d988d38 Merge branch 'PHP-8.2'
* PHP-8.2:
  Add regression test for GH-11682
2023-07-11 23:07:27 +02:00
Niels Dossche
3552a1be97 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Add regression test for GH-11682
2023-07-11 23:07:17 +02:00
Niels Dossche
48b246e038 Add regression test for GH-11682
This bug was already fixed via 15ff830, but we really need more
test coverage.

Co-authored-by: Arne Blankerts <arne@blankerts.de>
2023-07-11 23:02:01 +02:00
Niels Dossche
62a940880e Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10914: OPCache with Enum and Callback functions results in segmentation fault
2023-07-11 17:44:37 +02:00
Niels Dossche
832a3d193f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10914: OPCache with Enum and Callback functions results in segmentation fault
2023-07-11 17:40:21 +02:00
Niels Dossche
bc42179133 Fix GH-10914: OPCache with Enum and Callback functions results in segmentation fault
See linked issue for analysis.

Closes GH-11675.
2023-07-11 17:38:09 +02:00
Tim Düsterhus
c2cc1dbc85 [ci skip] NEWS / UPGRADING for ldap_connect with 2 arguments deprecation
see 69a8b63ecf
2023-07-11 17:34:38 +02:00
Derick Rethans
c24cf8d49a Merge branch 'PHP-8.2' 2023-07-11 16:30:18 +01:00
Derick Rethans
a4bdaeabf6 Fix bug GH-11600: Can't parse time strings which include (narrow) non-breaking space characters 2023-07-11 16:29:04 +01:00
Derick Rethans
b8fe445468 Merge branch 'timelib-2022-08-update' into PHP-8.2 2023-07-11 16:27:40 +01:00
Derick Rethans
c02ac26685 Import timelib 2022.08 2023-07-11 16:27:15 +01:00
George Peter Banyard
d510b5ae3e Remove assert.bail INI setting usage in DOMDocument tests 2023-07-11 16:20:21 +01:00
Niels Dossche
c1d4d9599a Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix tests for stat rdev
2023-07-11 13:57:34 +02:00
Niels Dossche
47b7570f07 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix tests for stat rdev
2023-07-11 13:57:28 +02:00
Niels Dossche
6b87e08b82 Fix tests for stat rdev
If HAVE_STRUCT_STAT_ST_RDEV is not set, rdev will be -1. %d only matches
a natural number, we should let it match negative numbers too.
2023-07-11 13:57:17 +02:00
Niels Dossche
75229cb127 Cleanup php_libxml_node_decrement_resource()
obj_node is already checked, so checking it again in the second if is
not necessary.
Merge declarations and assignments while we're at it.
2023-07-11 11:47:54 +02:00