-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 3.0.7-PL1, 3.0.8
-
Fix Version/s: None
-
Component/s: Posting, Viewing posts
-
Labels:None
-
Environment:PHP 5.3.1, MySQL 5.1.41, Opera 11 / Firefox 3.0.5
When using the extended [url=] BBCode to also use custom content for the link it is not possible to have linebreaks in it. The following usages will never validate:
[url=http://www.phpbb.com]Check out
phpBB 3.0.8![/url]
[url=http://www.phpbb.com][img]http://www.phpbb.com/theme/images/logo_phpbb.png[/img]
Check out phpBB![/url]
This is because in /includes/message_parser.php, function bbcode_init() we have:
$this->bbcodes = array( ... 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")),
...whereas the match pattern misses linebreaks.
I have two possible workarounds:
- adding the s modifier (but this will in first place also allow URLs with linebreaks):
'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#isUe' => "\$this->validate_url('\$2', '\$3')")),
- or indirectly allowing linebreaks by not allowing a character which should never occur (NUL):
'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\]([^\x00]*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")),
- duplicates
-
PHPBB3-217 Multiline [url] not Converted
-
- Closed
-