[gnome-calendar/mcatanzaro/add-calendar: 1/3] new-calendar-page: improve URI validity check



commit 72c022a04e00b9bb4ffb6d799e5388f7c3032324
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Apr 1 21:18:47 2020 -0500

    new-calendar-page: improve URI validity check
    
    This check passes if the URI is empty. Normally this callback only runs
    when there is text in the URL entry, but there is a race window where
    the user could delete it first. (Passing NULL to a SoupURI creates an
    invalid non-NULL empty URI that can be filled in later.)

 src/gui/calendar-management/gcal-new-calendar-page.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/gui/calendar-management/gcal-new-calendar-page.c 
b/src/gui/calendar-management/gcal-new-calendar-page.c
index 82af123e..e5e526c1 100644
--- a/src/gui/calendar-management/gcal-new-calendar-page.c
+++ b/src/gui/calendar-management/gcal-new-calendar-page.c
@@ -341,7 +341,7 @@ validate_url_cb (gpointer data)
   self->validate_url_resource_id = 0;
 
   uri = soup_uri_new (gtk_entry_get_text (self->calendar_address_entry));
-  valid_uri = uri != NULL;
+  valid_uri = uri != NULL && SOUP_URI_IS_VALID (uri);
 
   set_url_entry_error (self, !valid_uri);
 


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