|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56237 New bug linking system converts already linked text
Submitted: 2004-11-29 12:20 UTC Modified: 2006-12-26 23:51 UTC
From: papercrane at reversefold dot com Assigned: dufuz (profile)
Status: Closed Package: PECL bug system (PECL)
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: papercrane at reversefold dot com
New email:
PHP Version: OS:


 [2004-11-29 12:20 UTC] papercrane at reversefold dot com
See bug 2841:

In one of my comments I put in a link to a patch. It had the phrase bug2841 in it, which was turned into a link both within the href and in the text of the link, causing bad HTML. The bug linking should happen only when the text is not within another link.

Reproduce code:
Enter a link with bug2841 in a bug comment.

Expected result:
Link stays as-is.

Actual result:
Link has a new link embedded within the href.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-29 23:33 UTC] helgi at trance dot is
I'm not much of a regex person but I'll look into this, also someone removed the ability for #3454 to be turned into a link, at the moment either bug or request has to be infront of it :/
 [2004-11-29 23:37 UTC] papercrane at reversefold dot com
I'm the one who talked him out of letting #xxxx link to a bug. It's far too easy to type something like "Look at line #1234".

Also, I have a patch which would fix this, but it would take 5x the regexes as it goes a preemptive replace, then puts things back afterwards.
 [2004-11-29 23:47 UTC] helgi at trance dot is
Actually iirc you were only talking about on the wiki, but well, I still want to support also "Bugs #1, #2 and #4 where fixed" and the code at the moment can't do that, and the stuff that took only "#3" would be able to handle that I guess ...

I think in the bug system and in the changelogs, it's much less about people prefixing anything else then bug number with # really.

But well I'm going to let it be for now I guess.
 [2004-11-30 00:02 UTC] helgi at trance dot is
Hmm this is way out of my reach, someone with greater knowlagde of this thing has to do it.
 [2004-11-30 00:13 UTC] papercrane at reversefold dot com
I've prepared an untested patch which should fix this. Unfortunately, it adds 8 preg_replace calls to handle things. Could probably be pared down to 4 if we combine the 2 bug request regexes.
 [2004-11-30 00:22 UTC]
might I suggest we disable this auto-linking magic feature - it's a lot more trouble than it is worth.

 [2004-11-30 00:29 UTC] helgi at trance dot is
Patch didn't work :)

Greg, dunno about that, was thinking rather about moving it to ticket:345345 or bug:345 so It can't be mistaken, not even inside a link I suppose.
 [2004-11-30 00:33 UTC] helgi at trance dot is
heh I changed the patch, to do \<\a> and stuff to escape <> and well now it looks just as before the patch :)
 [2004-11-30 00:39 UTC] helgi at trance dot is
<\/a> doing this where </a> was did most of the trick, now all the links look right :)
But heh the link texts don't and when you add url, it goes over to the next comment header :)
But we're getting there.
 [2004-11-30 01:09 UTC] helgi at trance dot is
I decided to follow gregs advice, well in a way, now only request #454 and bug #454 auto links, thus it should fix the link issue people had, given that they don't have # also in the url :-) Which I highly doubt will happen.
 [2004-11-30 01:21 UTC] helgi at trance dot is
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PEAR better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 21:01:28 2024 UTC