BBcode identifier work differently in 3.2

Get help developing custom BBCodes or request one.
Post Reply
Tomba
Registered User
Posts: 130
Joined: Tue Jun 18, 2002 7:52 am
Location: Belgium
Name: Steven De Groote
Contact:

BBcode identifier work differently in 3.2

Post by Tomba » Sat Apr 29, 2017 12:25 pm

I've been using the following custom bbcode for years, and have found that since upgrading to 3.2, it behaves differently, and in this case, fails to render the clip.

Code: Select all

[youtube]http{TEXT4}://{TEXT1}youtube.com/{TEXT2}v={IDENTIFIER}{TEXT3}[/youtube]
To:

Code: Select all

<iframe width="560" height="315" src="https://www.youtube.com/embed/{IDENTIFIER}" frameborder="0" allowfullscreen></iframe>
TEXT3 is in place to cover cases where people try this: https://www.youtube.com/watch?v=lkp-_dwrr_8&dddd , so that the & and everything behind it is stripped off.
However, since phpbb3.2 , when you try https://www.youtube.com/watch?v=lkp-_dwrr_8 , the last character (here "8") is matched as TEXT3, even though it's a valid identifier character.

In 3.1, TEXT3 in this case matched nothing. In phpbb3.2, it matches "8".

Similarly, it seems that http:// links no longer work, because somehow TEXT4 must now match at least one character (which certainly was not the case before).

I wonder if this is the intention, or how I should change the BBCoode to get it working again?

Tomba
Registered User
Posts: 130
Joined: Tue Jun 18, 2002 7:52 am
Location: Belgium
Name: Steven De Groote
Contact:

Re: BBcode identifier work differently in 3.2

Post by Tomba » Wed May 10, 2017 8:06 pm

I little more investigation shows that whenever using a token, it will match at least one character.

The result is that in my above code, http:// doesn't work, as TEXT4 wants to be at least one char.

So, is it possible to define optional tokens?

User avatar
Armstrong
Registered User
Posts: 73
Joined: Sun Mar 25, 2007 2:26 am
Location: Oxford UK / Aix France.

Re: BBcode identifier work differently in 3.2

Post by Armstrong » Sat Jun 03, 2017 8:48 pm

What exactly are you trying to achieve here? It doesn't make sense.

Tomba
Registered User
Posts: 130
Joined: Tue Jun 18, 2002 7:52 am
Location: Belgium
Name: Steven De Groote
Contact:

Re: BBcode identifier work differently in 3.2

Post by Tomba » Sat Jul 01, 2017 9:25 pm

Armstrong wrote:
Sat Jun 03, 2017 8:48 pm
What exactly are you trying to achieve here? It doesn't make sense.
Well, the idea is that all the below URLs would work with this youtube bbcode:

https://www.youtube.com/watch?v=s69XiUdzbWg
https://www.youtube.com/watch?v=iOI2It_ ... ueVe9mYbnL

(The latter being a link followed on youtube from a suggested relevant clip).

Currently, the former format doesn't work anymore, since phpbb 3.2

Post Reply

Return to “Custom BBCode Development and Requests”

Who is online

Users browsing this forum: No registered users and 4 guests