1
0
mirror of https://github.com/php/php-src.git synced 2026-04-03 22:22:18 +02:00
Files
archived-php-src/ext/standard
Niels Dossche da6097ffc8 Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (<= PHP 8.3)
When we try to load an extension multiple times, we still overwrite the
type, module number, and handle. If the module number is used to
indicate module boundaries (e.g. in reflection and in dom, see e.g.
dom_objects_set_class_ex), then all sorts of error can happen.

In the case of ext/dom, OP's error happens because the following
happens:
- The property handler is set up incorrectly in
  dom_objects_set_class_ex() because the wrong module number is
  specified. The class highest in the hierarchy is DOMNode, so the
  property handler is incorrectly set to that of DOMNode instead of
  DOMDocument.
- The documentElement property doesn't exist on DOMNode, it only exists
  on DOMDocument, so it tries to read using zend_std_read_property().
  As there is no user property called documentElement, that read
  operation returns an undef value.
  However, the type is still checked, resulting in the strange exception.

Closes GH-12219.
2023-09-20 20:57:04 +02:00
..
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-07-15 12:48:09 +01:00
2020-10-26 11:06:10 +01:00
2020-06-17 13:04:01 +00:00
2020-04-14 15:16:26 +00:00
2023-02-12 21:33:39 -07:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-08-19 10:39:23 +02:00
2021-08-19 10:39:23 +02:00
2021-08-19 10:39:23 +02:00
2021-05-06 12:16:35 +02:00
2020-05-14 13:35:12 +02:00
2021-08-30 18:55:16 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-03-04 16:07:54 +01:00
2021-07-06 12:03:55 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-07-16 10:07:35 +02:00
2021-05-06 12:16:35 +02:00
2021-06-29 11:30:26 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-06-11 09:34:03 +02:00
2023-03-28 22:43:27 +02:00
2021-05-06 12:16:35 +02:00
2021-07-20 15:14:08 +02:00
2021-11-15 10:00:55 +01:00
2021-05-06 12:16:35 +02:00
2022-07-15 12:48:09 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2022-06-19 20:09:37 +01:00
2021-05-06 12:16:35 +02:00
2021-05-06 12:16:35 +02:00
2021-08-01 18:03:30 +01:00
2021-05-06 12:16:35 +02:00