After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 783046 - Invalid URIs are generated when q and q_internal properties are set
Invalid URIs are generated when q and q_internal properties are set
Status: RESOLVED FIXED
Product: libgdata
Classification: Platform
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: libgdata-maint
libgdata-maint
Depends on:
Blocks: 771390
 
 
Reported: 2017-05-24 13:51 UTC by Ondrej Holy
Modified: 2017-05-25 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix invalid URIs when q and q_internal properties are set (1.18 KB, patch)
2017-05-24 13:52 UTC, Ondrej Holy
none Details | Review
Fix invalid URIs when q and q_internal properties are set (1.18 KB, patch)
2017-05-25 12:02 UTC, Ondrej Holy
committed Details | Review

Description Ondrej Holy 2017-05-24 13:51:41 UTC
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.
Comment 1 Ondrej Holy 2017-05-24 13:52:20 UTC
Created attachment 352497 [details] [review]
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.
Comment 2 Philip Withnall 2017-05-24 14:51:11 UTC
Review of attachment 352497 [details] [review]:

::: gdata/gdata-query.c
@@ +446,3 @@
 			g_string_append_uri_escaped (query_uri, priv->q, NULL, FALSE);
+			if (priv->q_internal != NULL)
+				g_string_append (query_uri, " and ");

This should be URI-escaped, so I suspect it should be `"%20and%20"`.
Comment 3 Ondrej Holy 2017-05-25 12:02:35 UTC
Created attachment 352570 [details] [review]
Fix invalid URIs when q and q_internal properties are set

Thanks for the review. You are right. Although it works regardless of encoding, it should be encoded...
Comment 4 Philip Withnall 2017-05-25 13:05:03 UTC
Review of attachment 352570 [details] [review]:

Super, thanks.
Comment 5 Ondrej Holy 2017-05-25 13:22:24 UTC
Attachment 352570 [details] pushed as 868359d - Fix invalid URIs when q and q_internal properties are set