Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.2.4

Bug #1755 tags around an url -> mess
Submitted: 2004-06-30 18:18 UTC
From: mike Assigned: quipo
Status: Closed Package: HTML_BBCodeParser
PHP Version: Irrelevant OS: N/A
Roadmaps: (Not assigned)    
Subscription  


 [2004-06-30 18:18 UTC] mike
Description: ------------ If an URL is surrounded by another tag, i.e. [i], the output get messed up. Adding an opening bracket to the last character group of the first pattern solves this: "!(^|\s|\()((((http(s?)|ftp)://)|www)[-a-z0-9.]+\.[a-z]{2,4}[^\s()]*)!i" "!(^|\s|\()((((http(s?)|ftp)://)|www)[-a-z0-9.]+\.[a-z]{2,4}[^\s()\[]*)!i" Reproduce code: --------------- [i]www.php.net/downloads.php[/i]

Comments

 [2005-09-27 03:59 UTC] seth at pricepages dot org
I've created a new version of the filter Links.php that fixes Bugs #1388, #1512, #1755, and #3932. It also adds a few extra things, such as a list of accepted schemes, adding a trailing slash to the url where appropriate, and removing trailing whitespace from the file. Please bang on it and tell me what you think and send me a testcase/patch if something breaks. Like everyone here, I'd like this to be bulletproof. Maybe once the maintainer comes out of hibernation we can get this into the main tree. One thing that could be fixed is matching anything not "[url]" or "[url=" brackets in the first preparse regexp. I'm not sure the best regular expression there. Here is a link to the updated class: http://pricepages.org/bbcode/Link.php.zip
 [2005-09-27 13:43 UTC] seth at pricepages dot org
 [2005-10-18 13:12 UTC] quipo
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.