Details
-
Bug
-
Status: Closed (View Workflow)
-
Resolution: Fixed
-
3.0.RC5
-
None
-
PHP Environment: 5.2.2
Database: MySQL 5.0.37
Description
Following my earlier report and fix for the URL token being made clickable (http://www.phpbb.com/bugs/phpbb3/ticket.php?ticket_id=14151) I've checked on the fix and there seems to be another issue (which may have been there all along).
Given the custom BBCode
[link]{TEXT} {URL}[/link]
|
which is replaced by
<a href="{URL}">{TEXT}</a>
|
Then the test post
[link]something else http://www.ibboard.co.uk[/link]
|
gives us
<a href="else%20http://www.ibboard.co.uk">something</a>
|
where as it should give
<a href="http://www.ibboard.co.uk">something else</a>
|
I've not tracked down the exact cause or a fix yet, but it seems like the regex for the
{URL}token is matching spaces in what would be the domain section of the pattern, which is incorrect behaviour.
I thought the cause might be the numerous unescaped '.' characters in the patterns in get_preg_expression() in functions.php that were matching spaces rather than literal .s, but escaping them doesn't seem to have fixed it so far.
Hopefully I'll be able to provide more useful information when I work out what the rather complex regexes are doing!