After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 255224 - Complex URLs with '>', '"', and other invalid characters cause URLs to be truncated
Complex URLs with '>', '"', and other invalid characters cause URLs to be tru...
Status: RESOLVED WONTFIX
Product: GtkHtml
Classification: Other
Component: Parsing
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkhtml-maintainers
gtkhtml-maintainers
gnome[unmaintained]
Depends on:
Blocks: 681371
 
 
Reported: 2004-03-05 18:55 UTC by Ben Kahn
Modified: 2017-02-09 13:35 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ben Kahn 2004-03-05 18:55:34 UTC
Please fill in this template when reporting a bug, unless you know what you
are doing.
Description of Problem:
Complex URLs with '>', '"', and other invalid characters cause URLs to be
truncated

Bookmarklets are small one-line javascript functions designed to be run
through bookmarks.  I tried to email the following bookmarklet through
evolution:

javascript:(function(){var x,d,i,v,st; x=open(); d=x.document; d.open();
function
hE(s){s=s.replace(/&/g,"&amp;");s=s.replace(/>/g,"&gt;");s=s.replace(/</g,"&lt;");return
s;} d.write("<style>td{vertical-align:top; white-space:pre; } table,td,th {
border: 1px solid #ccc; } div.er { color:red }</style><table
border=1><thead><tr><th>Variable</th><th>Type</th><th>Value as
string</th></tr></thead>"); for (i in window) { if (!(i in x) ) {
v=window[i]; d.write("<tr><td>" + hE(i) + "</td><td>" +
hE(typeof(window[i])) + "</td><td>"); if (v===null) d.write("null"); else
if (v===undefined) d.write("undefined"); else try{st=v.toString(); if
(st.length)d.write(hE(v.toString())); else
d.write("\u00a0")}catch(er){d.write("<div
class=er>"+hE(er.toString())+"</div>")}; d.write("</pre></td></tr>"); } }
d.write("</table>"); d.close(); })();

using the "Insert Link" dialog.  When received, the link was printed like this:

/g,">");s=s.replace(/td{vertical-align:top; white-space:pre; } table,td,th
{ border: 1px solid ">Show all Javascript variables

and the link Evolution believed I was trying to send was:

javascript:(function(){var x,d,i,v,st; x=open(); d=x.document; d.open();
function hE(s){s=s.replace(/&/g,
Comment 1 Ben Kahn 2004-03-05 19:00:15 UTC
Here's a shorter (although not technically a legal URL) example:

http://example.com/"This<Test">is">"cool/

Is presented as:

is">"cool/">Testing...

Comment 2 Subodh Soni 2005-05-27 09:52:05 UTC
Ben: I am not able to replicate the behavior mentioned by you in the shorter
example. The line http://example.com/"This<Test">is">"cool/ gets received and
rendered properly and as it is and nothing is truncated from this line.
Can you please try with the following gtkhtml versions and kindly report the
observations here in the bug report:
gtkhtml2-3.6.2.0.200505251324-0.snap.novell.0.1
libgtkhtml-2.6.1-2.1
Comment 3 Bastien Nocera 2006-01-20 15:09:34 UTC
 From RFC 1738:
  Thus, only alphanumerics, the special characters "$-_.+!*'(),", and
  reserved characters used for their reserved purposes may be used
  unencoded within a URL.

So the hightlighted portion of:
http://example.com/"This<Test">is">"cool/
should be:
http://example.com/"This

But at the same time, it would mean that the URL parsing should be different for HTML and text mails should be different (ie. don't stop on ")
Comment 4 André Klapper 2017-02-09 13:35:52 UTC
GtkHtml is not under active development anymore. 
Evolution (its main consumer) switched to a WebKit backend a while ago. 
It is currently unlikely that there will be any further GtkHtml development.

Closing this report as WONTFIX as part of Bugzilla Housekeeping (bug 778387) to reflect reality. Please feel free to reopen this bug report in the future if anyone takes the responsibility for active development again.