[epiphany] ephy-embed-utils: Consider supported schemes for valid address checking



commit 11293728094c603d54c6d0f0e1d7062aa662c4f1
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Mon Sep 10 19:54:31 2018 +0200

    ephy-embed-utils: Consider supported schemes for valid address checking
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/90

 embed/ephy-embed-utils.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 226c12c20..cda37d9b8 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -205,19 +205,25 @@ ephy_embed_utils_address_is_valid (const char *address)
 {
   char *scheme;
   gboolean retval;
+  GAppInfo *info = NULL;
 
   if (!address)
     return FALSE;
 
   scheme = g_uri_parse_scheme (address);
 
-  retval = scheme ||
+  if (scheme != NULL) {
+    info = g_app_info_get_default_for_uri_scheme (scheme);
+    g_free (scheme);
+  }
+
+  retval = info ||
            ephy_embed_utils_address_is_existing_absolute_filename (address) ||
            g_regex_match (get_non_search_regex (), address, 0, NULL) ||
            is_public_domain (address) ||
            is_bang_search (address);
 
-  g_free (scheme);
+  g_clear_object (&info);
 
   return retval;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]