Skip to content
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

Typed property DOMDocument::$documentElement must not be accessed before initialization #241

Open
arifurrahmansw opened this issue Jan 30, 2023 · 12 comments

Comments

@arifurrahmansw
Copy link

image

@stof
Copy link
Collaborator

stof commented Jan 30, 2023

Please provide a reproducer (and ideally one that is built with only the library, not a Laravel app where the usage of the library is hidden in tens of abstraction levels).

@stof
Copy link
Collaborator

stof commented Jan 30, 2023

And can you tell which exact version of PHP you are using ? This might be a bug in ext-dom.

@arifurrahmansw
Copy link
Author

Thanks for the quick response. PHP 8.1

@stof
Copy link
Collaborator

stof commented Jan 30, 2023

that's not the exact version.

@arifurrahmansw
Copy link
Author

PHP 8.1.0 and Laravel Framework 8.83.27

@arifurrahmansw
Copy link
Author

when I upgrade laravel 6 to laravel 8 showing this error.

@stof
Copy link
Collaborator

stof commented Jan 30, 2023

Please upgrade to the latest 8.1.x release to see whether it fixes the issue. PHP has fixed many issues between 8.1.0 and 8.1.14

@fakeheal
Copy link

fakeheal commented May 2, 2023

I am having the same problem, my setup includes:

  • php: 8.1.17
  • tijsverkoyen/css-to-inline-styles: 2.2.6
  • laravel/framework: 9.52.7

PHP has fixed many issues between 8.1.0 and 8.1.14

What changes of php are releated to this package? Only changes related to DomDocument were last referred to in Version 8.1.11.

DOM:
Fixed bug #66783 (UAF when appending DOMDocument to element).

@stof
Copy link
Collaborator

stof commented May 2, 2023

Please try to build a standalone reproducer for this issue. Otherwise, there is nothing I can do to debug the issue.

@fakeheal
Copy link

fakeheal commented May 2, 2023

Please try to build a standalone reproducer for this issue. Otherwise, there is nothing I can do to debug the issue.

Yeah, sorry, I thought you might be able to suggest a possible problem off the top of your head, since you mentioned issues related to the package based on php's versions. I believe it'd be really hard to create a standalone reproducer of the issue, because as you said in Laravel "usage of the library is hidden in tens of abstraction levels".

Thank you for your time!

@stof
Copy link
Collaborator

stof commented May 2, 2023

Well, some of the PHP 8.1.x releases fixed issues related to typed properties in internal classes. But I'm not sure whether this is before or after 8.1.11.

@fakeheal
Copy link

I updated my servers php version to 8.2.4 and the issue is no longer there. I also noticed that there's a new 8.1.x version, but I didn't bother checking out before upgrading straight to 8.2. Leaving that here, hope it helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants