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 596717 - + (plus) character lost in searches
+ (plus) character lost in searches
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Backend
2.28.x
Other All
: Normal minor
: ---
Assigned To: Gustavo Noronha (kov)
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-09-29 10:54 UTC by Sam Morris
Modified: 2009-10-07 10:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix (1.32 KB, application/octet-stream)
2009-10-04 12:01 UTC, Gustavo Noronha (kov)
Details

Description Sam Morris 2009-09-29 10:54:08 UTC
When typing search terms into the address entry field, any + (plus) characters are lost when I hit enter.

For example, typing 'c++ blah' and hitting enter results in a google search for 'c   blah'.
Comment 1 Gustavo Noronha (kov) 2009-10-04 12:01:43 UTC
Created attachment 144707 [details]
fix
Comment 2 Gustavo Noronha (kov) 2009-10-04 12:04:33 UTC
The fact that I had to add + specifically in the escape_extra makes me wonder, though, if there is a bug in SoupURI. Dan? =)
Comment 3 Dan Winship 2009-10-04 13:44:49 UTC
Not a bug, no. "+" isn't normally reserved in URIs, but the HTML forms spec says that spaces in form parameters should be converted to "+" to make the URLs look nicer in the URL bar ("http://www.google.com/search?q=epiphany+web+browser" rather than "epiphany%20web%20browser") So then of course that means that "+" needs to be %-encoded.

Instead of

+    char *encoded_url = soup_uri_encode (url, "+");
+    effective_url = g_strdup_printf (_("http://www.google.com/search?q=%s&ie=UTF-8&oe=UTF-8"), encoded_url);

you could do:

    char *query_param = soup_form_encode ("q", url, NULL);
    effective_url = g_strdup_printf (_("http://www.google.com/search?%s&ie=UTF-8&oe=UTF-8"), query_param);

except that changes the translated string... so you'd have to use soup_form_encode() and then chop off the initial "q=" so you can tack it back on in the g_strdup_printf...
Comment 4 Dan Winship 2009-10-04 13:49:10 UTC
(btw, when I click on the attachment [which is currently tagged "application/octet-stream" by bugzilla] it opens in gedit rather then being displayed in epiphany? is content-sniffing happening at the wrong point in the process? or is that not a bug?)
Comment 5 Xan Lopez 2009-10-06 06:37:04 UTC
(In reply to comment #4)
> (btw, when I click on the attachment [which is currently tagged
> "application/octet-stream" by bugzilla] it opens in gedit rather then being
> displayed in epiphany? is content-sniffing happening at the wrong point in the
> process? or is that not a bug?)

Funny, all I can get is simply the download dialog :)

BTW, your suggested fix sounds good to me, so Gustavo feel free to commit that instead of the attached patch.
Comment 6 Gustavo Noronha (kov) 2009-10-06 06:57:13 UTC
(In reply to comment #4)
> (btw, when I click on the attachment [which is currently tagged
> "application/octet-stream" by bugzilla] it opens in gedit rather then being
> displayed in epiphany? is content-sniffing happening at the wrong point in the
> process? or is that not a bug?)

Without reinvestigating, being application/octet-stream makes it be sniffed as text/x-patch or something like that, which webkit thinks it isn't able to handle, so that is expected behavior. I don't know why the patches keep being assigned application/octet-stream =(.
Comment 7 Gustavo Noronha (kov) 2009-10-07 10:18:30 UTC
Pushed to master, thanks.