[epiphany] ephy-web-view: fix URI normalization



commit fcf23c9130758199c6519dbc4e59d49254f4681f
Author: Xan Lopez <xan igalia com>
Date:   Tue Aug 7 17:34:50 2012 +0200

    ephy-web-view: fix URI normalization
    
    Give SoupTLD nothing but the TLD when trying to figure out whether a
    URI actually has a TLD, otherwise it won't be happy. In particular:
    
    '.gnome.org' -> Not OK
    '.org' -> OK
    
    Add a test for this case.

 embed/ephy-web-view.c      |    2 +-
 tests/ephy-web-view-test.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 3ee698b..d8e5c7a 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2833,7 +2833,7 @@ is_public_domain (EphyWebView *view, const char *url)
     if (g_str_equal (url, "localhost"))
       return TRUE;
 
-    url = g_strstr_len (url, -1, ".");
+    url = g_strrstr (url, ".");
     if (!url || *url == '\0')
       return FALSE;
 
diff --git a/tests/ephy-web-view-test.c b/tests/ephy-web-view-test.c
index 32a86db..f2cedb5 100644
--- a/tests/ephy-web-view-test.c
+++ b/tests/ephy-web-view-test.c
@@ -287,7 +287,8 @@ static struct {
   { "lala.lala", "http://www.google.com/search?q=lala%2Elala&ie=UTF-8&oe=UTF-8"; },
   { "127.0.0.1", "http://127.0.0.1"; },
   { "http://127.0.0.1";, "http://127.0.0.1"; },
-  { "totalgarbage0xdeadbeef", "http://www.google.com/search?q=totalgarbage0xdeadbeef&ie=UTF-8&oe=UTF-8"; }
+  { "totalgarbage0xdeadbeef", "http://www.google.com/search?q=totalgarbage0xdeadbeef&ie=UTF-8&oe=UTF-8"; },
+  { "planet.gnome.org", "http://planet.gnome.org"; }
 };
 
 static void



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