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 #220

Open
alecpl opened this issue Dec 31, 2022 · 7 comments

Comments

@alecpl
Copy link
Contributor

alecpl commented Dec 31, 2022

I'm unable to reproduce, but one of Roundcube users created a ticket for this here.

This is with PHP 8.1.13:

PHP Fatal error:  Uncaught Error: Typed property DOMDocument::$documentElement must not be accessed before initialization in /var/www/roundcube/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php:275
Stack trace:
#0 /var/www/roundcube/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php(399): Masterminds\HTML5\Parser\DOMTreeBuilder->startTag()
#1 /var/www/roundcube/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php(141): Masterminds\HTML5\Parser\Tokenizer->tagName()
#2 /var/www/roundcube/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php(82): Masterminds\HTML5\Parser\Tokenizer->consumeData()
#3 /var/www/roundcube/vendor/masterminds/html5/src/HTML5.php(161): Masterminds\HTML5\Parser\Tokenizer->parse()
#4 /var/www/roundcube/vendor/masterminds/html5/src/HTML5.php(89): Masterminds\HTML5->parse()
#5 /var/www/roundcube/program/lib/Roundcube/rcube_washtml.php(698): Masterminds\HTML5->loadHTML()
@stof
Copy link
Contributor

stof commented Jan 30, 2023

Should be closed as the roundcube ticket was closed saying that upgrading PHP and roundcube fixed the issue.

@mti-1
Copy link

mti-1 commented Jun 7, 2023

Got the same problem on PHP8.1.18, but I can't update to PHP8.2 right now. Do you know what could cause the problem ?

@stof
Copy link
Contributor

stof commented Jun 7, 2023

try to update to PHP 8.1.19 (the latest 8.1 version). It might be enough to fix the issue.

@mti-1
Copy link

mti-1 commented Jun 7, 2023

Solved it, I had an extension=dom inside a php.ini file, maybe there was a conflict because of this. i've been stuck 3 days on this.

@nielsdos
Copy link

nielsdos commented Sep 21, 2023

Fwiw this was a php bug and is fixed in 8.1.25 and 8.2.12 (not released yet)

@stof
Copy link
Contributor

stof commented Sep 22, 2023

@nielsdos can you link to the PHP bug (or to the PR fixing it) ?

@nielsdos
Copy link

@stof fix for stable versions: php/php-src#12219
fix for master: php/php-src#12246

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

4 participants