[libgdata] Fix invalid URIs when q and q_internal properties are set



commit 868359d3803e87dea2a0ce0531ca25a42af3f9b9
Author: Ondrej Holy <oholy redhat com>
Date:   Wed May 24 15:37:50 2017 +0200

    Fix invalid URIs when q and q_internal properties are set
    
    get_query_uri produces invalid URIs for cases when q and q_internal
    properties are set, because any separator isn't added between them.
    Consequently, the queries end up with errors. Let's add " and " between
    them to fix this issue.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783046

 gdata/gdata-query.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gdata/gdata-query.c b/gdata/gdata-query.c
index ebddeac..5e903ea 100644
--- a/gdata/gdata-query.c
+++ b/gdata/gdata-query.c
@@ -442,8 +442,11 @@ get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboo
                APPEND_SEP
                g_string_append (query_uri, "q=");
 
-               if (priv->q != NULL)
+               if (priv->q != NULL) {
                        g_string_append_uri_escaped (query_uri, priv->q, NULL, FALSE);
+                       if (priv->q_internal != NULL)
+                               g_string_append (query_uri, "%20and%20");
+               }
                if (priv->q_internal != NULL)
                        g_string_append_uri_escaped (query_uri, priv->q_internal, NULL, FALSE);
        }


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