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

Bug #12644 [url=http://www.google.nl]http://www.google.nl[/url] expands strange
Submitted: 2007-12-09 12:27 UTC
From: jakster Assigned: doconnor
Status: Closed Package: HTML_BBCodeParser (version 1.2.2)
PHP Version: 5.2.0 OS: Debian
Roadmaps: (Not assigned)    
Subscription  


 [2007-12-09 12:27 UTC] jakster (Jesper Smith)
Description: ------------ See the code examples. To fix this (I got no time to make a patch, sorry), add beneath: //If we have an intro tag that is [url], then skip this match if ($matches[1] == $o.'url'.$c) { return $matches[0]; } the following code: elseif(preg_match("/\[url=(.*)\]/i",$matches[1])){ return $matches[0]; } Test script: --------------- [url=http://www.google.nl]http://www.helpalot.org[/url] Expected result: ---------------- <a href="http://www.google.nl">http://www.helpalot.org</a> Actual result: -------------- <a href="http://www.google.nl">[url=http://www.helpalot.org/]http://www.helpalot.org</a>

Comments

 [2008-08-09 00:12 UTC] abuchanan (Alex Buchanan)
Confirmed, I had the same problem. Different answer though, Links.php.patch-v1 attached.
 [2011-09-16 18:05 UTC] ic_weener (Ic Weener)
My Solution is: in Links.php from: $o = $options['open']; $c = $options['close']; //If we have an intro tag that is [url], then skip this match if ($matches[1] == $o.'url'.$c) { return $matches[0]; } to: $o = $options['open']; $c = $options['close']; $oe = $options['open_esc']; $ce = $options['close_esc']; //If we have an intro tag that is [url], then skip this match if (preg_match("/".$oe."url(=[^\s()\[\]=]+)?".$ce."/i",$matches[1])) { return $matches[0]; }
 [2012-01-02 08:03 UTC] doconnor (Daniel O'Connor)
-Status: Open +Status: Closed -Assigned To: +Assigned To: doconnor
This bug has been fixed in SVN. 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.