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

Bug #9960 Parsing of named links returns unexpected results
Submitted: 2007-01-29 00:19 UTC
From: webmaster at dasourcerer dot net Assigned:
Status: Open Package: Text_Wiki_BBCode (version CVS)
PHP Version: 4.3.10+ OS: Windows XP SP2a, Linux
Roadmaps: (Not assigned)    
Subscription  


 [2007-01-29 00:19 UTC] webmaster at dasourcerer dot net (Stephan Hohmann)
Description: ------------ Parsing named links results in a link which is immediately closed, followed by the name of the link and then the exact same link again. One example taken from your documentation: [url=http://www.totalgeek.org]totalgeek.org[/url] will result in <a href="http://totalgeek.org" onclick="window.open(this.href, '_blank'); return false;"></a>totalgeek.org<a href="http://totalgeek.org" onclick="window.open(this.href, '_blank'); return false;"></a> I checked this with both, v0.0.4-alpha and the CVS version. Both are showing this behaviour. Unfortunately I do not understand your RegExes well enough to provide a solution for this... On a sidenote: Parsing will fail at all if the protocol for the link is omitted. For instance [url=totalgeek.org]totalgeek.org[/url] won't parse at all. I'm not quite certain if this qualifies as a bug, but since you allow relative links, I thought you should know.

Comments

 [2007-01-31 08:32 UTC] toggg (bertrand Gugger)
[url=http://www.totalgeek.org]totalgeek.org[/url] gives <p><a href="http://www.totalgeek.org" onclick="window.open(this.href, '_blank'); return false;">totalgeek.org</a></p> so looks right. You mentionned php version is irrelevant , it is certainly not as we depend on pcre. Please confirm the php version and the OS for which you get this result.
 [2007-01-31 18:36 UTC] webmaster at dasourcerer dot net
I jsut checked for PCRE. It's version 6.6.
 [2007-02-03 00:22 UTC] webmaster at dasourcerer dot net
Update: I've just checked this with an updated build of PHP (v5.2.0) linked with PCRE v6.7. Same problem.
 [2007-03-01 16:51 UTC] webmaster at dasourcerer dot net
And two new ones: PHP v4.3.10 with PCRE v4.5 on a Debian system and PHP v5.2.1 with PCRE v6.7 on Windows XP SP2a. Out of curiosity: Which version of PCRE are you using? 7.0? If so, I might give it a try...
 [2007-03-07 23:19 UTC] toggg (bertrand Gugger)
Perhaps I get the story, as I corrected http://pear.php.net/bugs/9393 , I used the possibility for url rule to be built with 2 tokens : start and end. What was released in 0.0.4 Unfortunately, I did not realized this feature was only recently added as in http://cvs.php.net/viewvc.cgi/pear/Text_Wiki/Text/Wiki/Render/Xhtml/Url.php?r1=1.13&r2=1.14 So, my guess is now that you run Text_Wiki 1.1.0 and not 1.2.0RC or cvs as me. I just tested it out with 1.1.0 and I reproduce your bug So, try to upgrade to Text_Wiki-1.2.0RC1, please. Unfortunately, we did not have the idea to check dependencies ... We'll need to issue a new Text_Wiki_BBCode version.
 [2007-03-08 00:13 UTC] toggg (bertrand Gugger)
Actually, even Text_Wiki-1.2.0RC1 is too old, we need a cvs version of Text_Wiki, I guess we'll have to organize quickly some release. So if you can try with Text_Wiki from cvs, at least the Xhtml render rule for Url: Text/Wiki/Render/Xhtml/Url.php
 [2007-04-21 17:05 UTC] dasourcerer (Stephan Hohmann)
I've now tried several combinations of using Text/Wiki/Parse/BBCode/Url.php and Text/wiki/Render/Xhtml/Url.php from both CVS and the packages releases to no avail.
 [2008-07-21 12:28 UTC] doconnor (Daniel O'Connor)
1) Text_Wiki 1.2.0 (stable) was released on 2007-06-10 (Changelog). 2) Have you tried it in a newer version of PHP 3) Any chances of a slightly better test case (an executable one) - some us aren't too familar with the API
 [2008-07-21 12:52 UTC] webmaster at dasourcerer dot net
Uh, sorry. I've been developing my own BBCode parser in the meantime and lost track of this... So, this is PHP v5.2.5 w/ PCRE v7.3 on Windows XP: Text_Wiki (v1.2.0) and Text_Wiki_BBCode (v0.0.4-alpha) are working as expected. I can no longer spot this behaviour.
 [2008-07-21 13:00 UTC] dasourcerer (Stephan Hohmann)
Ah, hold on. I just saw this: Omitting the protocol part of the link destination will still give odd results: [url=www.totalgeek.org]totalgeek.org[/url] => <a href="www.totalgeek.org" onclick="window.open(this.href, '_blank'); return false;">totalgeek.org</a> [url=totalgeek.org]totalgeek.org[/url] => [url=totalgeek.org]totalgeek.org[/url]