bbcode.php line 121 preg_replace() compilation failed warning after upgrade

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Post Reply
EA117
Registered User
Posts: 20
Joined: Wed Aug 15, 2018 3:23 am

bbcode.php line 121 preg_replace() compilation failed warning after upgrade

Post by EA117 » Wed Aug 15, 2018 7:24 am

I am upgrading a 3.0.14 PHP 5.4 board to 3.2.2 PHP 7.2, and with the 3.2.2 board otherwise successfully running I've made the strange observation of the issue described here. Specifically the PHP warning in my case is:

Code: Select all

[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 121: preg_replace(): Compilation failed: unrecognized character after (?< at offset 69
Although I cannot state it to a technical certainty, it seems like the issue is exhibiting for posts which used a particular BBCode; in my case it's "[link]". All the posts which have caused the "PHP Warning" thus far are existing posts which used the [link] BBCode. Note the OP of the previous report had concluded that "bbcode_bitfield set to AAI=" seemed to be the common denominator; in my case bbcode_bitfield on a broken post happens to be "UQAACA==".

But creating a new post that uses [link] is not an issue. And if I edit a currently "broken" post, it becomes "fixed" and no longer presents the PHP Warning. Looking at the SQL table entry for a post that goes from "broken" to "fixed" shows the following types of changes:

Message editor shows:

Code: Select all

Below you will find downloads to the patches and mods that we run on this DesertCombat server.

[b]DC/DC Final Downloads[/b]

[u][b]Patches[/b][/u]

[link=1.6 Patch]http://ea117dcfanfavorites.com/battlefield_1942_patch_v1.6.19.zip[/link]
SQL before editing in 3.2.2 shows:

Code: Select all

..., 'Below you will find downloads to the patches and mods that we run on this DesertCombat server.  \n\n[b:2oo7k6ip]DC/DC Final Downloads[/b:2oo7k6ip]\n\n[u:2oo7k6ip][b:2oo7k6ip]Patches[/b:2oo7k6ip][/u:2oo7k6ip]\n\n[link=1.6 Patch:2oo7k6ip]http&#58;//ea117dcfanfavorites&#46;com/battlefield_1942_patch_v1&#46;6&#46;19&#46;zip[/link:2oo7k6ip]\n\n', '62dcf0ffbcddb1313c2cd20472105d6d', 0, 'UQAACA==', '2oo7k6ip', 1, 0, '', 0, 0, 0, 1, 0, '', 0)
SQL after editing in 3.2.2 shows:

Code: Select all

..., 'Below you will find downloads to the patches and mods that we run on this DesertCombat server.<br/>\n<br/>\n<B><s>[b]</s>DC/DC Final Downloads<e>[/b]</e></B><br/>\n<br/>\n<U><s>[u]</s><B><s>[b]</s>Patches<e>[/b]</e></B><e>[/u]</e></U><br/>\n<br/>\n<LINK content=\"http://ea117dcfanfavorites.com/battlefield_1942_patch_v1.6.19.zip\" link=\"1.6 Patch\"><s>[link=1.6 Patch]</s><LINK_TEXT text=\"http://ea117dcfanfavorites.com/battlefi ... 1.6.19.zip\">http://ea117dcfanfavorites.com/battlefield_1942_patch_v1.6.19.zip</LINK_TEXT><e>[/link]</e></LINK><br/>\n<br/>\n', '91da3c91229b9b40f67ae33e3f3af45c', 0, '', '2oo7k6ip', 1, 0, '', 0, 0, 0, 1, 0, '', 0)
I can only guess that maybe the BBCode user ID suffixes being applied (":2oo7k6ip") are somehow throwing a curve at the parsing of the [link] output? Or were those HTML entities not expected to still be there? But I have no idea whether that's really the issue, or whether the format of an existing message still having those BBCode user ID suffixes appended is "expected" or "unexpected" once I've achieved a 3.2.2 board. Versus whether maybe these existing messages were supposed to have already been touched and processed in bulk during a prior upgrade step, to already look more like the latter example after I manually touched the post.

My upgrade method was to use STK database cleaner against the 3.0.14 database, and then first upgrade to 3.1.12 using the recommended steps of deleting everything except /store /files /images and config.php and uploading the 3.1.12 full installation set and then invoking /install/database_update.php. (It required two steps -- "start" and then a "continue" to finish the database update -- but reported success without timeout at the end.) Then repeating the same "remove everything except" steps and this time uploading the 3.2.2 full installation set and then invoking /install/ and using the "Update" tab to initiate an "update database only" operation. (Which also reported 100% success without reporting a timeout.)

Does my "broken" message still showing the constructs shown in the SQL data above indicate a problem or missing upgrade process? Or is that format still normal and expected for "legacy" messages still in the 3.2.2 database, and I simply still haven't identified what's truly unique or wrong with the messages that fail to render successfully?

Thanks. -Trench

User avatar
david63
Jr. Extension Validator
Posts: 14645
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: bbcode.php line 121 preg_replace() compilation failed warning after upgrade

Post by david63 » Wed Aug 15, 2018 8:07 am

Have all your old posts been reparsed yet?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

EA117
Registered User
Posts: 20
Joined: Wed Aug 15, 2018 3:23 am

Re: bbcode.php line 121 preg_replace() compilation failed warning after upgrade

Post by EA117 » Wed Aug 15, 2018 2:25 pm

(Trench misses the point about what "reparse" meant.)
Last edited by EA117 on Wed Aug 15, 2018 3:59 pm, edited 1 time in total.

User avatar
david63
Jr. Extension Validator
Posts: 14645
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: bbcode.php line 121 preg_replace() compilation failed warning after upgrade

Post by david63 » Wed Aug 15, 2018 2:54 pm

david63 wrote:
Wed Aug 15, 2018 8:07 am
Have all your old posts been reparsed yet?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

EA117
Registered User
Posts: 20
Joined: Wed Aug 15, 2018 3:23 am

Re: bbcode.php line 121 preg_replace() compilation failed warning after upgrade

Post by EA117 » Wed Aug 15, 2018 3:30 pm

Then I don't know what that means in context of the 3.2.2 board. Incorrectly interpreted it as a reference to the re-parsing / re-writing that occurred for the existing BBCode references when I manually touched the message. Something you're saying the upgrade process should have done, or...?

Have found the other discussions of "bbcode.php line 121", and that "reparse" is in reference to a cron job that should eventually run. Thanks for the pointer. I was incorrectly assuming something like this, if it was necessary, had already happened during the upgrade.

So in short: Yes, the messages are expected to still be in that format. And yes, they do need to change before they will render correctly. And yes, it will happen on its own eventually, but not during the upgrade itself.

-Trench

Post Reply

Return to “[3.2.x] Support Forum”

Who is online

Users browsing this forum: Exabot, php.exe, texasbushcraft and 42 guests