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 374627 - Wrongly escaped URL in error message
Wrongly escaped URL in error message
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Interface
2.17.x
Other Linux
: Normal normal
: ---
Assigned To: Diego Escalante Urrelo (not reading bugmail)
Marco Pesenti Gritti
Depends on:
Blocks:
 
 
Reported: 2006-11-13 10:33 UTC by Bastien Nocera
Modified: 2007-01-08 23:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Changes rawurl.get() for url.get() (695 bytes, patch)
2006-12-28 11:10 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review
Escapes the url correctly, courtesy of glib. (773 bytes, patch)
2006-12-31 18:10 UTC, Diego Escalante Urrelo (not reading bugmail)
reviewed Details | Review

Description Bastien Nocera 2006-11-13 10:33:24 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.
Comment 1 Christian Persch 2006-12-17 14:42:59 UTC
Should be easy to fix; code is in embed/mozilla/EphyAboutModule.cpp
Comment 2 Diego Escalante Urrelo (not reading bugmail) 2006-12-22 07:07:12 UTC
So it's fault of nsCAutoString?
Comment 3 Diego Escalante Urrelo (not reading bugmail) 2006-12-28 11:02:29 UTC
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.
Comment 4 Diego Escalante Urrelo (not reading bugmail) 2006-12-28 11:10:51 UTC
Created attachment 78982 [details] [review]
Changes rawurl.get() for url.get()

LOL. Simple as that.
Comment 5 Diego Escalante Urrelo (not reading bugmail) 2006-12-30 20:40:50 UTC
bug #351296 caused this.
Comment 6 Diego Escalante Urrelo (not reading bugmail) 2006-12-30 20:46:59 UTC
I assume that replacing '&' as &amp; 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.
Comment 7 Diego Escalante Urrelo (not reading bugmail) 2006-12-31 18:10:35 UTC
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.
Comment 8 Diego Escalante Urrelo (not reading bugmail) 2006-12-31 18:26:27 UTC
Duuuuh, should use g_markup_printf_escaped() instead of g_strdup_printf()!.

:)
Comment 9 Christian Persch 2007-01-08 22:30:43 UTC
Indeed :)

With that fixed and tested, please commit to trunk and 2-16.
Comment 10 Diego Escalante Urrelo (not reading bugmail) 2007-01-08 23:17:28 UTC
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.