Bug #119
& is copied as &
| Status: | Closed | Start: | ||
| Priority: | Normal | Due date: | ||
| Assigned to: | - | % Done: | 100% |
|
| Category: | UserInterface | |||
| Target version: | - | |||
| Operating System: | All |
Reported in: | 0.9 |
|
Description
If psi has a URL such as:
http://psi.affinix.com/flyspray/?do=details&id=118
copying location or clicking it will cause the entity to be resolved (& becomes &). This is probably wrong.
History
Updated by Anatoly Piskunov 932 days ago
in XHTML - & in url and other must be &
in HTML - & may be & in <a href="index.php?id=1&od=2">
i think QT make link as browser
so if you see link http://psi.affinix.com/flyspray/?do=details&id=118 - its make <a href="http://psi.affinix.com/flyspray/?do=details&id=118">http://psi.affinix.com/flyspray/?do=details&id=118</a>
and browsers see it as http://psi.affinix.com/flyspray/?do=details&id=118
its Ok for xhtml
Updated by - duryodhan 908 days ago
I really didn't understand this, isn't what psi doing correct? URLs are supposed to have '&' and not '&'. The latter is meant only for inside XHTML/HTML docs.
In the worst case , where you just want to do a query with a '&' in the URL but thats not part of the GET params, then & is sent as %26 (like %20 for space).
Is this still a bug ?
Updated by Martin H. 908 days ago
Yes, this is a bug. if somebody has a url that contains & for some reason (maybe a parameter called amp;foo) than psi should not change this.
the url should go to the browser like it's displayed on the screen, apart from transformation that are the right thing to do for urls (i.e. iri->uri transformations when the target browser doesn't understand iri, escaping spaces etc)
Updated by - duryodhan 904 days ago
adding the following lines to textutil.cpp
336 : +QString pre2 = out.mid(x1, x2-x1);
int cutoff2;
for(cutoff2 = pre2.length()-1; cutoff2 >= 0; --cutoff2) {
if(!linkify_isOneOf(pre2.at(cutoff2), "!?,.()[]{}<>\""))
break;
}
++cutoff2;
and line 351 : -href += link;
+href += pre2.mid(0,cutoff2);
makes it work
although this is a little ugly.