Cannot load XML: Premature end of data in tag br line 1 [generate_text_for_display]

Get help with installation and running phpBB 3.3.x here. Please do not post bug reports, feature requests, or extension related questions here.
[email protected]
Registered User
Posts: 4
Joined: Thu Nov 23, 2023 6:46 am

Cannot load XML: Premature end of data in tag br line 1 [generate_text_for_display]

Post by [email protected] »

Hi everybody
I'm using prosilver
Language pack FR
Sqlite3
php 8.2

Since last update (phpbb 3.3.11) ... same trouble with phpbb 3.3.11 installed from scratch

I had theses errors in my php log file :

Code: Select all

[24-Nov-2023 12:41:42 UTC] PHP Fatal error:  Uncaught InvalidArgumentException: Cannot load XML: Premature end of data in tag br line 1 in /var/www/html/aeroinfo_phpbb/vendor/s9e/text-formatter/src/Renderer.php:46
Stack trace:
#0 /var/www/html/aeroinfo_phpbb/vendor/s9e/text-formatter/src/Renderers/PHP.php(303): s9e\TextFormatter\Renderer->loadXML()
#1 /var/www/html/aeroinfo_phpbb/vendor/s9e/text-formatter/src/Renderer.php(66): s9e\TextFormatter\Renderers\PHP->renderRichText()
#2 /var/www/html/aeroinfo_phpbb/phpbb/textformatter/s9e/renderer.php(250): s9e\TextFormatter\Renderer->render()
#3 /var/www/html/aeroinfo_phpbb/includes/functions_content.php(600): phpbb\textformatter\s9e\renderer->render()
#4 /var/www/html/aeroinfo_phpbb/viewtopic.php(1763): generate_text_for_display()
#5 {main} thrown in /var/www/html/aeroinfo_phpbb/vendor/s9e/text-formatter/src/Renderer.php on line 46
Is there any solution ? Or do I to find it by myself ? (I'm a php developper, so, after a few hours I can)
Last edited by Mick on Sat Nov 25, 2023 9:13 am, edited 1 time in total.
Reason: Code tags added for clarity & moved to 3.3 support.
[email protected]
Registered User
Posts: 4
Joined: Thu Nov 23, 2023 6:46 am

Re: Cannot load XML: Premature end of data in tag br line 1 [generate_text_for_display]

Post by [email protected] »

So as nonoby has idea, I'm looking for a solution by myself

I've discovered that phpbb send data containing <br> tags and these tags makes loadXML function to result with an InvalidArgumentException
But why is it not possible to load xml strings containing <br> ?
So as loadxml can load data containing <br/> (but not containing <br> or </br> .... strange !!)
I decide to replace all <br> tags by <br/> in xml string before trying to load (not a very good solution, I know) but it works until a phpbb update

Return to “[3.3.x] Support Forum”