View Issue Details

IDProjectCategoryView StatusLast Update
0004931mantisbtwebpagepublic2005-04-18 10:35
ReporterTomR Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionduplicate 
Product Versiongit trunk 
Summary0004931: http links are broken before the '?' question mark.
Description

http://bugs.mantisbt.org/bugnote_edit_page.php?bugnote_id=8492

This link shows up right in 0.19.1, however in 0.19.2-CVS it is broken before the questionmark.

TagsNo tags attached.
Attached Files
htmllinkbroken.gif (5,023 bytes)   
htmllinkbroken.gif (5,023 bytes)   

Relationships

duplicate of 0004962 closedbpfennig URL not parsing after ? in any link 

Activities

TomR

TomR

2004-12-06 02:33

reporter   ~0008520

Can anyone verify this, we use quite a lot of external links with parameters, so this is a nasty problem for us.

TomR

TomR

2004-12-12 11:37

reporter   ~0008586

Last edited: 2004-12-12 11:40

Problem lies in 0.19.2 because now Mantis is experiencing the same problem!

The link here-after is copied/pasted from the browser.

http://bugs.mantisbt.org/view.php?id=4931

bpfennig

bpfennig

2004-12-12 14:48

reporter   ~0008588

Since 0.19.1 the link recognition algorithm changed twice - the first version in 0.19.1 (implemented by me ;) ) works fine but had a little overhead and one problem, it doesn't work with links like this:

http://www.google.com
http://www.google.com/error.html

The second link was not parsed correctly, because the first link was part of the second.

The changes made in 0.19.2 (not by me ;) ) are made to get rid of the overhead and correct the problem descriped above - so the algorithm changed back to old one (before 0.19.1) with some improvements.

I think we should discuss a new algorithm :)

TomR

TomR

2004-12-13 11:36

reporter   ~0008599

Am I correct that the error in 0.19.2 can not be corrected immediatly. Our databas eis full of those links and users depend on them. Can tou give me some instructions how to get back to 0.19.1 behaviour? So I can manually change sources and make sure they are not overwritten.

bpfennig

bpfennig

2004-12-13 12:11

reporter   ~0008600

Last edited: 2004-12-13 12:13

As a small bugfix you can change the following line in core/string_api.php (line 295)

Replace this:


$p_string = pregreplace('/([http|irc|ftp|https]{2,}:\/\/([a-z0-9-]|\/|\@|:{0,1}.{0,1}){1,})/'<a href="\1">\1</a> [<a href="\1" target="blank">^</a>]',$p_string);

by this:


$p_string = pregreplace('/([http|irc|ftp|https]{2,}:\/\/([a-z0-9-]|\?|=|#|&|\/|\@|:{0,1}.{0,1}){1,})/','<a href="\1">\1</a> [<a href="\1" target="blank">^</a>]',$p_string);

But this is not the best solution - while testing I found some links which are not parsed correctly, even with that changes.