FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » usage of url tag fails with relative links
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
usage of url tag fails with relative links [message #15145] Wed, 03 December 2003 21:56 Go to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
Up to RC8 it was possible to use the url tag of FUD for relative links as well. This makes sense if you just want to point to something on the same server and saves some typing.
However I've just noticed that this seems to be somewhat broken. When providing a relative url by using:
[url=../doc/RTFM.php]Manual[/url]

an "http://" gets appended and terribly messes up the whole thing.

However, providing an absolute url doesn't work either because then the "http://" will be appended once more and cause an invalid url.

Correcting this link or restore it to a relative url by editing the message will make the link completely go away. The editing mode then will reveal some html code used for generating the link, which shouldn't be around at all.

I don't know whether it's been already fixed, but I thought mentioning it couldn't hurt. The installation is a stock RC 9 with the exception that I replaced the src file which caused the newline issue (see other thread started by me) with the fixed one from CVS.

Olliver
Re: usage of url tag fails with relative links [message #15146 is a reply to message #15145] Wed, 03 December 2003 22:43 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
This is intentional. Many people seems to put things like www.furbar.com into URLs and the missing http:// prefix results in a broken URL. All but a few 'expert' users realize and use things like ../ or /blah/blah/ etc...

I'll review the code and see if ../ and / support can be added back in.


FUDforum Core Developer
Re: usage of url tag fails with relative links [message #15198 is a reply to message #15146] Fri, 05 December 2003 12:59 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
I ve just installed RC10.
Absolute urls are working again, however relative ones still append "http://" to the URI. I don't think this is a wise approach, because you hardcode the protocol though you don't know in advance whether the forum will run with HTTPS or not. If SSL is used and someone points to a link on the local server, the visitors will be forced to leave the SSL connection. This may lead to some brokeness. Another downside is in case of moving to another server the stuff which was locally linked isn't portable any longer because of hardcoded URLs which need to be manually fixed.

When you use the img tag, it still accepts relative urls. I think you should either completely disable relative URLs or allow them but treating one tag different from another though there's no real reason for it is quite confusing.

I understand that bad coded stuff may lead to security problems with directory traversals once relative URLs are used, but are you someone writing bad code? I don't think so Smile

just my 2 ¢

Olliver
Re: usage of url tag fails with relative links [message #15201 is a reply to message #15198] Fri, 05 December 2003 13:06 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The 'relative' urls below seems to work fine, is there something I am forgetting to test?

../
/

Please keep in mind that relative URLs such as ../ will not work with PATH_INFO because they would be relative path will include path_info.


FUDforum Core Developer
Re: usage of url tag fails with relative links [message #15207 is a reply to message #15201] Fri, 05 December 2003 13:32 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
Well, I wonder why relative urls always worked before RC9 despite using path info. I don't think this is the result of me being too stupid to correctly enter a relative path. I'm constantly doing it when pointing to threads which have already been discussed.
It is broken when you use it like that:

[url=theme/default/images/top_members.png]Members[/url]




It correctly shows "members" as link however the relative url is borked (http is appended)
------------------------------
[img]theme/default/images/top_members.png[/img]


theme/default/images/top_members.png

works as expected

------------------------------
[url=../topbar.gif]link[/url]


../topbar.gif

link works, but the name is wrong, it should be "link"

---------------

[img]../topbar.gif[/img]


../topbar.gif

works as expected


I always give a short name to my links to avoid endless trails of arguments behind a query string which may mess up the forum's formating. But as you see, the issues are independent from "path info"

HTH

Olliver

[Updated on: Fri, 05 December 2003 13:47]

Report message to a moderator

Re: usage of url tag fails with relative links [message #15208 is a reply to message #15207] Fri, 05 December 2003 13:37 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The relative URLs with path_info thanks to base href that is set in the header.

The relative URLs that start with a non ../ or / I have not considered and will need to review the code to make sure those still work.

[url=../topbar.gif]link[/url] handling is a bug and I'll work on getting it fixed.


FUDforum Core Developer
Re: usage of url tag fails with relative links [message #15209 is a reply to message #15208] Fri, 05 December 2003 13:45 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
Thanks a lot. Luckily the issue is independent from path info, otherwise I'd have had a hard time proving what I was stating Wink

Olliver
Re: usage of url tag fails with relative links [message #15210 is a reply to message #15209] Fri, 05 December 2003 13:51 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
Hm. I've just corrected the code for the img tag. This caused the first example to completely disappear though I didn't touch it. Looking at the code it modified the original code to that:

<a href="http://theme/default/images/top_members.png" target="_blank"></a>


Quite annoying issue, but for some reasons it still works for the img tag.

Olliver
Re: usage of url tag fails with relative links [message #15212 is a reply to message #15209] Fri, 05 December 2003 14:28 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The attached script should take care of the URL problem.

FUDforum Core Developer
Re: usage of url tag fails with relative links [message #15213 is a reply to message #15212] Fri, 05 December 2003 15:20 Go to previous messageGo to next message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
Doesn't entirely solve the problem. The good thing is, the http:// no longer gets appended. But there's sort of unexpected behaviour now.

if I use the link

[url=theme/default/images/top_members.png]Members[/url] are here.


and edit the post it will cause the output to disappear because the link gets modified to that:

[url=theme/default/images/top_members.png][/url].


anything beyond the the closing "url" tag gets cut off.

Olliver

[Updated on: Fri, 05 December 2003 15:22]

Report message to a moderator

Re: usage of url tag fails with relative links [message #15216 is a reply to message #15213] Fri, 05 December 2003 15:40 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
This version should fix that problem.

FUDforum Core Developer
Re: usage of url tag fails with relative links [message #15220 is a reply to message #15216] Fri, 05 December 2003 17:25 Go to previous message
Olliver   Germany
Messages: 443
Registered: March 2002
Karma: 0
Senior Member
I tested that one thouroughly but...
Reveal Spoiler


Thanks
Olliver
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: v2.6.0RC10 - Timeout when trying to edit large post
Next Topic: Problem with Textfields
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Sep 29 02:21:57 GMT 2024

Total time taken to generate the page: 0.02953 seconds