GNOME Bugzilla – Bug 374627
Wrongly escaped URL in error message
Last modified: 2007-01-08 23:17:28 UTC
epiphany-2.16.0-4.fc6 firefox-1.5.0.7-7.fc6 Error message shows an escaped path instead of a nice name: bugzilla.gnome.org/show_bug.cgi?id=374335 The page “http%3A%2F%2Fbugzilla.gnome.org%2Fshow_bug.cgi%3Fid%3D374335” in this tab was not fully loaded yet when the web browser crashed; it could have caused the crash. Should have been: bugzilla.gnome.org/show_bug.cgi?id=374335 The page “http://bugzilla.gnome.org/show_bug.cgi?id=374335” in this tab was not fully loaded yet when the web browser crashed; it could have caused the crash.
Should be easy to fix; code is in embed/mozilla/EphyAboutModule.cpp
So it's fault of nsCAutoString?
From embed/mozilla/EphyAboutModule.cpp around line 521: (...) nsCAutoString error, rawurl, url, charset, title; rv = ParseURL (spec.get (), error, rawurl, url, charset, title); if (NS_FAILED (rv)) return rv; if (rawurl.IsEmpty () || url.IsEmpty()) return NS_ERROR_FAILURE; nsCOMPtr<nsIURI> uri; rv = NS_NewURI(getter_AddRefs (uri), url, charset.get()); NS_ENSURE_SUCCESS (rv, rv); char *secondary = g_strdup_printf (_("The page “%s” in this tab was not fully loaded yet when " "the web browser crashed; it could have caused the crash."), rawurl.get()); (...) Funny thing is that I can't make Ephy crash in the exact moment to get the message.
Created attachment 78982 [details] [review] Changes rawurl.get() for url.get() LOL. Simple as that.
bug #351296 caused this.
I assume that replacing '&' as & would do it. Also I imagine this should be fixed in whatever gives us the url? Or should we do it in the printing meanwhile.
Created attachment 79118 [details] [review] Escapes the url correctly, courtesy of glib. Ignore the g_print(). I think this patch solves this bug without reopening the other one.
Duuuuh, should use g_markup_printf_escaped() instead of g_strdup_printf()!. :)
Indeed :) With that fixed and tested, please commit to trunk and 2-16.
Committed to both: 2007-01-08 Diego Escalante Urrelo <diegoe@svn.gnome.org> * embed/mozilla/EphyAboutModule.cpp: Fixes the escaping in the error message "The page %s was not fully loaded yet when the browser crashed..." by changing the g_strdup_printf into a g_markup_printf_escaped. Bug #374627. Patch by Diego Escalante Urrelo.