View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005220 | mantisbt | bugtracker | public | 2005-02-07 22:22 | 2009-06-26 11:59 |
Reporter | iamcal | Assigned To | grangeway | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | ||
Product Version | 0.19.2 | ||||
Summary | 0005220: url parser makes a few mistakes | ||||
Description | it doesn't allow [?=&] in urls, making urls with querystrings break it doesn't allow capital letters in urls it gets confused when urls have '@' symbols in them, after the first slash the attched patch fixes these issues | ||||
Tags | No tags attached. | ||||
Attached Files | core__string_api.php.diff (963 bytes)
--- core/string_api.php.orig 2005-02-07 12:23:52.725125000 -0800 +++ core/string_api.php 2005-02-07 12:22:54.287625000 -0800 @@ -292,7 +292,7 @@ return $p_string; } # Find any URL in a string and replace it by a clickable link - $p_string = preg_replace( '/([http|irc|ftp|https]{2,}:\/\/([a-z0-9_-]|\/|\@|:{0,1}\.{0,1}){1,})/', + $p_string = preg_replace( '/([http|irc|ftp|https]{2,}:\/\/([a-zA-Z0-9_-]|\/|\@|[?=&]|:{0,1}\.{0,1}){1,})/', '<a href="\1">\1</a> [<a href="\1" target="blank">^</a>]', $p_string); @@ -304,7 +304,7 @@ # when applied to data that has already had entities inserted. # # bpfennig: '@' doesn't accepted anymore - $t_atom = '[^\'@\'](?:[^()<>@,;:\\\".\[\]\000-\037\177 &]+)'; + $t_atom = '[^\'@\'](?:[^()<>@,;:\/\\\".\[\]\000-\037\177 &]+)'; # In order to avoid selecting URLs containing @ characters as email # addresses we limit our selection to addresses that are preceded by: | ||||
parent of | 0004439 | closed | grangeway | Mailto links include an unneccessary 'target="_new"' |
has duplicate | 0006583 | closed | ryandesign | URL handling is broken. |
has duplicate | 0006576 | closed | ryandesign | Upper case (Capitol) letters break HTML Links |
has duplicate | 0006375 | closed | vboctor | Posting web links |
child of | 0005460 | closed | vboctor | Critical Issues to Fix for Mantis 1.0.0 Release |
This issue has already been fixed I believe - can you try http://cvs.sourceforge.net/viewcvs.py/*checkout*/mantisbt/mantisbt/core/string_api.php?rev=1.64 Feel free to reopen if not. Paul |
|
@@ -304,7 +304,7 @@ when applied to data that has already had entities inserted.
And actually, this might still need doing. |
|
I lifted the latest version of the change from the CVS and patched it in to 19.2 - it fixed a problem I had with a URL with ? and &. However still had a problem with a URL of http://usertools.plus.net/@gateway which gets changed to a mailto The change in note 9262 is not in CVS - when I applied that it fixed the problem. |
|
I think there may still be a problem with email addresses. I have colon space preceeding the email address for example: abc@domainname.com. The href produced has the leading space included as part of the mailto e.g. mailto:%20abc@... If I am right it will happen in this note. |
|
I was right you can see the problem in the last note. But there appears to be another problem as well - where did the "/>" come from? |
|
The "/>" is the rest of a line break tag. If you hover your mouse over the Link in 0005220:0010058, so can see the following link target in your status bar:
|
|
This bug ought to have a relationship with 0004439 added. |
|
The url parsing functionality has been rewritten since 2005/6 ;/ Paul |
|