-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOMElement::replaceWith
causes crash
#11290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
Oh, looks like this could be a duplicate of #9142. |
This one's also fixed by #11299, so I'll amend that PR to include this test. Thanks for the report & testcase! |
nielsdos
added a commit
to nielsdos/php-src
that referenced
this issue
May 22, 2023
…placeWith This replaces the implementation of before and after with one following the spec very strictly, instead of trying to figure out the state we're in by looking at the pointers. Also relaxes the condition on text node copying to prevent working on a stale node pointer.
nielsdos
added a commit
to nielsdos/php-src
that referenced
this issue
May 22, 2023
…ception with replaceWith This replaces the implementation of before and after with one following the spec very strictly, instead of trying to figure out the state we're in by looking at the pointers. Also relaxes the condition on text node copying to prevent working on a stale node pointer.
nielsdos
added a commit
that referenced
this issue
May 25, 2023
… segfaults with replaceWith This replaces the implementation of before and after with one following the spec very strictly, instead of trying to figure out the state we're in by looking at the pointers. Also relaxes the condition on text node copying to prevent working on a stale node pointer. Closes GH-11299.
nielsdos
added a commit
that referenced
this issue
May 25, 2023
nielsdos
added a commit
that referenced
this issue
May 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
This is a longstanding one (sorry for the
php-dom
day!). Sometimes the same code from #11288 causes crash on every 8.x PHP version. The code is the same, but the html markup is slightly differs.Live reproducing:
https://3v4l.org/KjJgQ // On every PHP 8.x version throws
DOMException: Not Found Error
, hangs for 1-15 seconds, then crashes.https://3v4l.org/FdOZR // Hangs for 1-15 seconds, crashes on every PHP versions but PHP 8.2.6 and 8.1.19.
It's kinda related to #11289 and #11288, but this is a longstanding one. I guess this is a part of a big picture, so I hope this would help to investigate the main cause of weird
php-dom
behavior.The following code:
results in crash on every PHP 8.x version.
PHP Version
PHP 8.x
Operating System
No response
The text was updated successfully, but these errors were encountered: