{URL}
token, I stumbled on a bug after I updated it.After several hours, I found the issue, and I was able to fix it, but it's a strange one. Because I can duplicate the bug even when creating a new bbcode with the
{URL}
token in it. So it's not a case of a bad edit of an old bbcode.Here is my info, so you know what I am working with:
Code: Select all
phpBB 3.1.12
PHP: 5.6.34
MySQL: 5.5.58-cll
Advanced BBCode Box 3 Extension v3.14
{URL}
token (and then save your changes -- you don't need to edit anything) or create a new one with the {URL}
token.STEP 1:
Go ahead and create the following test BBCODE:
BBCode usage
[test]{URL}[/test]
HTML replacement
Code: Select all
Just a simple test: <a href="{URL}" class="postlink">Click Here</a>.
Just a test.
STEP 2:
Now go to your forum and try to create a post or reply with the above bbcode you created.
It should look like this in your post box:
Code: Select all
[test]https://www.phpbb.com[/test]
DO NOT SUBMIT, instead press PREVIEW.
You will see two things:
1) you will see the following errors on the very top of your phpBB board:
Code: Select all
[phpBB Debug] PHP Warning: in file [ROOT]/includes/message_parser.php on line 84: preg_match(): Compilation failed: unrecognized character after (?< at offset 39
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5348: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3937)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5348: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3937)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 5348: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3937)
It will look like this:
Code: Select all
[test]https://www.phpbb.com[/test]
So it seems that it also affects all the rest of the bbcodes -- you don't even need to use the one you just created, you will see those errors no matter what you try when you press PREVIEW.
STEP 3:
The only way to remove those errors from showing on your header is:
1) delete the bbcode from the ACP that you just created or edited. That will fix it so those errors above don't show anymore.
2) or go into your mySQL database,
- find that bbcode under
phpbb_bbcodes
, - find your bbcode that you created
test
, - press the edit button for that bbcode
- and look inside these two boxes:
first_pass_match
andsecond_pass_match
- and find and replace the following strange code:
(?<\!javascript)
- Save your changes and you can now use that bbcode without any issues.
Code: Select all
update phpbb_bbcodes set first_pass_match = replace(first_pass_match, '(?<\!javascript)', '');
update phpbb_bbcodes set second_pass_match = replace(second_pass_match, '(?<\!javascript)', '');
So I guess, for some odd reason, that strange code is being added to the database:
(?<\!javascript)
-- and that is the problem!FYI: I tested this issue with several phpBB 3.1.x boards I have, and I can duplicate this issue on my server.
Plus I tested this issue with a test phpBB 3.2.x board that I have on the same server, and no issues with that version. So I suspect it may be just phpBB 3.1.x issue?
Let me know if you have any further questions or things you want me to try??
NOTE: I had originally posted this bug in this section, but was told by the developer that I should post it in the main forum. I figure, the bbcode section should be the place?