GNOME Bugzilla – Bug 255224
Complex URLs with '>', '"', and other invalid characters cause URLs to be truncated
Last modified: 2017-02-09 13:35:52 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,"&");s=s.replace(/>/g,">");s=s.replace(/</g,"<");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,
Here's a shorter (although not technically a legal URL) example: http://example.com/"This<Test">is">"cool/ Is presented as: is">"cool/">Testing...
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
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 ")
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.