PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Text » Text_Wiki_BBCode » Bug #9960

Parsing of named links returns unexpected results

Details

Submitted2007-01-29 00:19 UTC
Fromwebmaster at dasourcerer dot net
StatusOpen
PackageText_Wiki_BBCode
PHP Version4.3.10+
OSWindows XP SP2a, Linux
Roadmaps(Not assigned)

Comments

[2007-01-29 00:19 UTC] webmaster at dasourcerer dot net

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.

[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...

[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.