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

Bug #12215 [url] doesn't work like expected
Submitted: 2007-10-10 09:56 UTC
From: zedel Assigned:
Status: Open Package: HTML_BBCodeParser (version 1.2.2)
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2007-10-10 09:56 UTC] zedel (Go Away)
Description: ------------ HTML_BBCodeParser replaces everything which looks like a url with a link, not only in [url] tags. And there is no easy way to disable smarterPPLinkExpand (please, no 'but i know better what you want' - systems without a way to disable them) Test script: --------------- $parser = new HTML_BBCodeParser(array('filters' => 'Basic,Email,Extended,Images,Links')); $parser->qparse("This is an example for www.php.net: <link>http://www.php.net</link> and here is the real link: [url=http://www.php.net/]PHP[/url]"); Expected result: ---------------- his is an example for www.php.net: <link>http://www.php.net</link> and here is the real link: <a href="http://www.php.net">PHP</a>

Comments

 [2007-10-19 14:14 UTC] inspirationdate (Mike Walsh)
This is really messy. If we list the filters with Links before Images, images get parsed as urls first and then the image parsing doesn't work. Works fine: filters = Images,Links Is broken: filters = Links,Images smarterPPLinkExpand skips urls that are in [url] tags, can't this just be extended to include all tags? And zedel is right, this really needs to be something we can enable/disable.
 [2008-11-07 13:26 UTC] rmens (Robert Mens)
Same problem exists with the Email filter, which replaces all email addresses instead of only those in [email] tags.
 [2012-01-02 08:14 UTC] doconnor (Daniel O'Connor)
Patches welcome folks, I have no clear idea on how to fix this. The Images/Links default behaviour has been fixed, so it should happen less. Email behaviour is unchanged atm.