Version: (using KDE 4.1.1) OS: Linux Installed from: Ubuntu Packages When you go to: http://[IPv6 address]/ konqueror loads the page correctly. However after loading, konqueror changes the address string to: http://IPv6 address/ (the [] are gone). This makes it not possible to reload the page without editing the address.
This still happens for me. I'm using latest Factory-packages from openSUSE. (Version 4.1.87). This is only a problem with IPv6 ip addresses, IPv6 Internet over DNS works just fine. (So ipv6.google.com just works nice)
And another thing to mention: this happens not only with http(s), but also all other protocols like fish:// and so on.
Hi, I found out, this happens because of KUrl::prettyUrl() not printing out "[]" for IPv6 addresses. It uses the QUrl::host() method to determine the host-part of the URL. For IPv6 addresses this is without the brackets. KUrl::prettyUrl() should add these brackets, I think. According to RFC4038 the square brackets should be added, if the address occurs in conjunction to a TCP port number (which is also separated by a colon) or something similar. It also states, that parsers should not force users to use these brackets. QUrl does, if I tested that right and so KUrl::prettyUrl() should _allways_ add the square brackets to an IPv6 address. This behaviour would be okay, as all parsers should be able to parse IPv6 addresses including square brackets, also they are not in conjunction with any colons that belong to other data, than the address itself. To check if a given string represents a valid IPv6 address isn't this easy. There is a regexp, which is quite long. ;) So I thought of a shorter way to fix this issue. I mentioned, that QUrl::host() seems to only return valid hosts. I think, hostnames can never contain colons, only IPv6 addresses can. So QUrl::host().contains(":") should be a valid check for that. If we can use contains(":"), this fix should be easy. Otherwise the regexp needs to be used as a valid check. bye then julian
*** Bug 195651 has been marked as a duplicate of this bug. ***
*** Bug 195929 has been marked as a duplicate of this bug. ***
So this is a kdelibs bug, reassigning.
Marking as JJ, a fix with Julian's proposal (which should be enough to fix this) should be trivial.
Created attachment 34421 [details] patch kurl.cpp add brackets if host contains a colon Guess this should be enough
Created attachment 34422 [details] patch kurltest.cpp Add an ipv6 address testcase for pretty url
SVN commit 982329 by dfaure: Apply patch from Wieger Hofstra to fix IPV6 in prettyUrl() - thanks! (patch slightly modified for performance) BUG: 171562 M +6 -1 io/kurl.cpp M +4 -0 tests/kurltest.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=982329