Bug tracker
Multiline [url] not Converted (new)
Please refer to this test post in the development forums for an example.
Comments / History
Might be a bit slower though.
Open "includes/message_parser.php"
Find
- Code: Select all
array('#\[url(=(.*))?\](.*)\[/url\]#iUe'
Add the 's':
- Code: Select all
array('#\[url(=(.*))?\](.*)\[/url\]#iUes'
------------
Can i ask why can't be fixed?
Multiline urls are allowed in html, are allowed in ALL board engine i test (Invision, vBulletin, SMF for example).
I'm developing tools that generate bbcodes... ok that doesn't exists an official standard, but exists some "agreement" that are respected by all board, except phpBB. This issue is one of them.
I'm only want to understand why, thanks.
I wasn't pointing out that line terminators should be allowed within the actual URI, but within the textual data that's displayed:
[url=http://www.phpbb.com/]phpBB
forums[/url]
Currently, the above BBCode will not be parsed at all. Even if the devs would prefer it doesn't actually insert line breaks, it may be helpful to some users if the BBCode parser at least parse the tag, converting the line breaks into spaces. Most, if not all, user agents will parse this just fine:
<a href="http://www.phpbb.com/">phpBB
forums</a>
A patched regex pattern should not apply the /s modifier to the whole pattern, but only the group matching the text between the tags. It would make life easier to start using the /x modifier, too. It's a lot easier to maintain complex regex patterns.
Open "includes/message_parser.php"
Find
- Code: Select all
'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")),
In-line Find
- Code: Select all
'#\[url(=(.*))?\](.*)\[/url\]#iUe'
In-line replace:
- Code: Select all
'#\[url(=(.*))?\]((?s).*)\[/url\]#iUe'
Just a note: the BBCode parser will, in fact, convert users' line breaks to <br> tags.
Not also multiline url are allowed by html standard, but also Invision, vBulletin, SMF, in general all forum board engine i tested support multiline url.
Invision doesn't support in 1.x release, but was fixed at least in 2.x.
In my specific case, i have a tools that convert news from html to bbcode format, and multiline url are frequently used; for example, different thumbnail images, separated every X image, for creating a grid of screenshots; all surrounded by unique url to a complete gallery.
What i need to do, repeat the URL tag every line?
Honestly, if all the board engine, and also HTML, allow multiline url, this issue in phpBB must be a bug, imho. Secondly, if you don't want to fix, the ticket status "Will not fix" may be more correct.
do yourself a favor and get a dictionary.