diff options
author | Dan Vrátil <dvratil@redhat.com> | 2012-04-27 23:53:42 +0800 |
---|---|---|
committer | Dan Vrátil <dvratil@redhat.com> | 2012-04-27 23:58:35 +0800 |
commit | a593d514c872dace24e899c1ccb25955f985cbc4 (patch) | |
tree | 1d57327c79e6370e896667ca3ea8e535c334a816 | |
parent | 8d62e55014aaf14205fc1ae3ca7edc7d21dd45d7 (diff) | |
download | gsoc2013-evolution-a593d514c872dace24e899c1ccb25955f985cbc4.tar gsoc2013-evolution-a593d514c872dace24e899c1ccb25955f985cbc4.tar.gz gsoc2013-evolution-a593d514c872dace24e899c1ccb25955f985cbc4.tar.bz2 gsoc2013-evolution-a593d514c872dace24e899c1ccb25955f985cbc4.tar.lz gsoc2013-evolution-a593d514c872dace24e899c1ccb25955f985cbc4.tar.xz gsoc2013-evolution-a593d514c872dace24e899c1ccb25955f985cbc4.tar.zst gsoc2013-evolution-a593d514c872dace24e899c1ccb25955f985cbc4.zip |
Bug #674466 - Mail's preview panel can show listing of local filesystem root
-rw-r--r-- | mail/e-mail-display.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 0b1c343646..1ffeb82c1b 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -384,6 +384,19 @@ mail_display_link_clicked (WebKitWebView *web_view, EMailDisplay *display; const gchar *uri = webkit_network_request_get_uri (request); + if (g_str_has_prefix (uri, "file://")) { + gchar *filename; + filename = g_filename_from_uri (uri, NULL, NULL); + + if (g_file_test (filename, G_FILE_TEST_IS_DIR)) { + webkit_web_policy_decision_ignore (policy_decision); + webkit_network_request_set_uri (request, "about:blank"); + return TRUE; + } + + g_free (filename); + } + display = E_MAIL_DISPLAY (web_view); if (display->priv->formatter == NULL) return FALSE; @@ -448,7 +461,7 @@ mail_display_resource_requested (WebKitWebView *web_view, const gchar *uri = webkit_network_request_get_uri (request); if (!formatter) { - webkit_network_request_set_uri (request, "invalid://uri"); + webkit_network_request_set_uri (request, "about:blank"); return; } @@ -499,7 +512,7 @@ mail_display_resource_requested (WebKitWebView *web_view, * a native placeholder for it. */ if (!stream && !display->priv->force_image_load && !em_format_html_can_load_images (display->priv->formatter)) { - webkit_network_request_set_uri (request, "invalid://protocol"); + webkit_network_request_set_uri (request, "about:blank"); return; } |