diff options
author | Michael Catanzaro <mcatanzaro@igalia.com> | 2015-07-25 16:01:39 -0500 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@igalia.com> | 2015-07-27 19:38:01 -0500 |
commit | b2f5f1af21a9204c2645e6f56749d8aa6492351b (patch) | |
tree | 5c9452c37677f90d4edc1b83d41ad7a8f388ee7c | |
parent | 2e42c298bc656cbd2ab02dbec2f45327dbfbb34d (diff) | |
download | epiphany-b2f5f1af21a9204c2645e6f56749d8aa6492351b.tar.gz |
EphyWebView: Decode URI before setting the loading or status message
This ensures that the URI displayed in the floating bar is decoded.
https://bugzilla.gnome.org/show_bug.cgi?id=710004
-rw-r--r-- | embed/ephy-web-view.c | 15 | ||||
-rw-r--r-- | embed/ephy-web-view.h | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 339f171b6..17d7496a6 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1522,9 +1522,11 @@ ephy_web_view_set_loading_message (EphyWebView *view, g_clear_pointer (&priv->loading_message, g_free); if (address) { + char *decoded_address; char *title; - title = ephy_embed_utils_get_title_from_address (address); + decoded_address = g_uri_unescape_string (address, NULL); + title = ephy_embed_utils_get_title_from_address (decoded_address); if (title != NULL && title[0] != '\0') { /* translators: %s here is the address of the web page */ @@ -1533,6 +1535,7 @@ ephy_web_view_set_loading_message (EphyWebView *view, priv->loading_message = g_strdup (_("Loading…")); } + g_free (decoded_address); g_free (title); } @@ -2486,16 +2489,17 @@ ephy_web_view_get_link_message (EphyWebView *view) /** * ephy_web_view_set_link_message: * @view: an #EphyWebView - * @link_message: new value for link-message in @view + * @address: new value for link-message in @view * * Sets the value of link-message property which tells the URL of the hovered * link. **/ void ephy_web_view_set_link_message (EphyWebView *view, - const char *link_message) + const char *address) { EphyWebViewPrivate *priv; + char *decoded_address; g_return_if_fail (EPHY_IS_WEB_VIEW (view)); @@ -2503,7 +2507,10 @@ ephy_web_view_set_link_message (EphyWebView *view, g_free (priv->link_message); - priv->link_message = ephy_embed_utils_link_message_parse (link_message); + decoded_address = g_uri_unescape_string (address, NULL); + priv->link_message = ephy_embed_utils_link_message_parse (decoded_address); + + g_free (decoded_address); g_object_notify (G_OBJECT (view), "status-message"); g_object_notify (G_OBJECT (view), "link-message"); diff --git a/embed/ephy-web-view.h b/embed/ephy-web-view.h index 2530bf795..8211d6cdb 100644 --- a/embed/ephy-web-view.h +++ b/embed/ephy-web-view.h @@ -120,7 +120,7 @@ EphyWebViewNavigationFlags ephy_web_view_get_navigation_flags (EphyWebView const char * ephy_web_view_get_status_message (EphyWebView *view); const char * ephy_web_view_get_link_message (EphyWebView *view); void ephy_web_view_set_link_message (EphyWebView *view, - const char *link_message); + const char *address); void ephy_web_view_set_security_level (EphyWebView *view, EphySecurityLevel level); const char * ephy_web_view_get_typed_address (EphyWebView *view); |